Self-built test environment: LAMP
The traditional LAMP package is Linux + apache + mysql + PHP. Linux as an operating system, apache as the server, mysql as the database, and PHP as the interface between the server and the database (and cgi). Although the four are relatively independent, the four are perfectly capable of matching up and forming an efficient web server. I installed LAMP on my computer to test wordpress. If the test is successful, you can rent a host that supports PHP and mysql, and run the wordpress site on it.
In the test environment, you can use your browser to access http://localhost, or http://127.0.0.1, or local IP to access the site.
MAC OS X can use MAMP, which provides MAC + apache + mysql + PHP. You can have a free version at http://www.mamp.info.
The Ubuntu system installs LAMP suit
(different versions of Linux, MAC, and Windows can be installed with a *amp suit, which can be used for GuGe queries.)
The default root of the Apache server is /var/WWW. With such a default configuration, you just need to put your site’s files, such as index.html, into /var/www, without having to do too much.
Sometimes we want to adjust the configuration of the root directory. We create our own mysite configuration based on the 000-default configuration:
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/mysite.conf
Modify /etc/apache2/sites- available/mysite, change all of the/var/WWW to/home/vamei/mysite, which is the starting directory of our site. You can select the appropriate directory for your situation, replace it here and later/home/vamei/mysite
Such changes, visitors may not have permission to access/home/vamei/mysite, can modify the/etc/apache2 / apache2.conf file, found
<Directory /var/www> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
Copy this paragraph and paste it in the back, changing the/var/WWW to/home/vamei/mysite
Load mysite configuration
The following commands can be used to view existing sites:
Now, we’re going to use mysite configuration. Stop the default site and start the custom site:
sudo a2dissite 000-default && sudo a2ensite mysite sudo service apache2 reload
The default site may not be called 000-default. According to the return results of apache2ctl-s, the above commands are modified accordingly.
sudo /etc/init.d/apache2 restart
Create /home/vamei/mysite/index.html, and write in it:
<p>HTML test success!</p>
Now open the brower to test if this content is display well.
Create database for wordpress
use below command to enter mysql
mysql -u root -p mysql> CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_genercal_ci; mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpresspassword';
wget http://wordpress.org/latest.tar.gz tar -xzvf latest.tar.gz
To make sure yo have rights to wirte wp-config.php in root folder. You can change the foler owner to Apache user or grant ‘write’ to it then can be install successfully. Enter http://localhost and follow the steps to install wordpress.
sudo chown -R :www-data /your/wordpress/root/folder sudo chmod -R 775 /your/wordpress/root/folder/storage
WordPress is an easy to use and makes many interfaces beautiful, simple and comfortable.