标签:des http io ar os sp for strong on
This page will describe the steps you have to take to install LAMP, which stands for Linux Apache MariaDB PHP. This page will show you, how to set up a working Apache2 webserver, a configured MariaDB database server, to install PHP5, working with Apache, and finally, phpMyAdmin with a configured pmadb database.
This article is updated to reflect the installation in openSUSE 13.1. However it it does not deviate much from lower versions of openSUSE.
Every time you want to change anything to the system, you will need root access. You can get this by:
The console will now ask you for the password you selected at the installation, enter that password and press enter again. If you logged in successfully, the user name and the computer name should be displayed in red now.
To install software, make sure that you have root access. We will install our software using YaST from the command line.
This also installs the packet apache2-example-pages, which provides an example page when accessing the web server.
To start Apache, execute
Note: If you ever want to restart apache, execute
or if you want to stop it
This does not start the apache server after a reboot. To enable that, give the command
Now that you have installed apache2, you want to check if it works. The packet apache2-example-pages installed the file /srv/www/htdocs/index.html, which contains:
Note: You can create a new file and edit it by using your favorite editor.
You can now start your favorite browser. Navigate to ‘localhost‘. You should see ‘It works!‘.
In this state the web server is only accessible as localhost. You have to open port http (=80) in the firewall. You can do that using YaST, selecting Security and Users --> Firewall --> Allowed services and add HTTP server. You may also edit the line with FW_CONFIGURATIONS_EXT= in it in the file /etc/sysconfig/SuSEfirewall2 and add apache2 in that line. A space is used in that line to separate elements. After editing you have to restart the firewall using:
To install software, you need root access. When you have root access, execute
or
Don‘t forget to enable mod-php by executing
Now you have installed PHP5.
Now that you have installed PHP5, you have to restart the apache2 webserver to get some results. You can restart apache by executing
with root access.
That was pretty easy, but now you want to test it out, don‘t you? So, we go to the htdocs folder again by executing
Make a new file named index.php and with the following content:
Now, open your favorite browser again and navigate to ‘localhost/index.php‘. If everything went alright then you should see ‘You successfully installed PHP5!‘.
We need to install mariadb and mariadb-tools, mariadb-tools is necessary for the administration, execute
or
with root access.
MariaDB is an alternative package for MySQL, so further on the name mysql is used.
To start the MariaDB server, execute
You may want to read the messages issued by the server in /var/log/messages.
Note: If you ever want to restart mysql, execute
or if you want to stop it
This does not start the mysql server after a reboot. To enable that, give the command
To set the root password for the first time:
If you ever want to change your password later:
Now you can log in into the server client by executing
Enter
to go back to the terminal.
phpMyAdmin, or pma is a tool to administrate your databases. The installation process is quite easy.
Install phpMyAdmin by executing
or
This also installs a number of needed php5 modules and restarts the apache2 server.
To log in to phpMyAdmin:
To configure phpMyAdmin, we need to edit the configuration file. It is found in /etc/phpMyAdmin/config.inc.php.
$cfg[‘Servers‘][$i][‘controluser‘] = ‘somename‘; $cfg[‘Servers‘][$i][‘controlpass‘] = ‘somepassword‘; /*Advanced phpMyAdmin features */ $cfg[‘Servers‘][$i][‘pmadb‘] = ‘phpmyadmin‘; $cfg[‘Servers‘][$i][‘bookmarktable‘] = ‘pma__bookmark‘; $cfg[‘Servers‘][$i][‘relation‘] = ‘pma__relation‘; $cfg[‘Servers‘][$i][‘table_info‘] = ‘pma__table_info‘; $cfg[‘Servers‘][$i][‘table_coords‘] = ‘pma__table_coords‘; $cfg[‘Servers‘][$i][‘pdf_pages‘] = ‘pma__pdf_pages‘; $cfg[‘Servers‘][$i][‘column_info‘] = ‘pma__column_info‘; $cfg[‘Servers‘][$i][‘history‘] = ‘pma__history‘; $cfg[‘Servers‘][$i][‘tracking‘] = ‘pma__tracking‘; $cfg[‘Servers‘][$i][‘designer_coords‘] = ‘pma__designer_coords‘;
GRANT USAGE ON mysql.* TO ‘somename‘@‘localhost‘ IDENTIFIED BY ‘somepassword‘; GRANT SELECT ( Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv ) ON mysql.user TO ‘somename‘@‘localhost‘; GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO ‘pmagebruiker‘@‘localhost‘; GRANT SELECT ON mysql.db TO ‘somename‘@‘localhost‘; GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO ‘somename‘@‘localhost‘;
and import that file via the Import tab.
==================================================================
https://en.opensuse.org/SDB:LAMP_setup
https://en.opensuse.org/SDB:Linux_Apache_MySQL_PHP
http://os.51cto.com/art/201203/323578.htm
http://www.unixmen.com/install-lamp-server-apache-mariadb-php-opensuse-13-213-1/
http://ben-it.org/content/open-suse-123-install-lamp-server
标签:des http io ar os sp for strong on
原文地址:http://www.cnblogs.com/forcheryl/p/4121224.html