If Don’t how install Lampp server see this tutorial
Creating WordPress MySQL Database
Our WordPress will require a database and a database user. To create one, simply use the following commands. Feel free to replace the database name, user and password as per your preferences:
# mysql -u root -pEnter password: ## Create database ##CREATE DATABASE wordpress;## Creating new user ##CREATE USER wordpress@localhost IDENTIFIED BY "secure_password";## Grant privileges to database ##GRANT ALL ON wordpress.* TO wordpress@localhost;## FLUSH privileges ##FLUSH PRIVILEGES;## Exit ##exit
Preparing WordPress Installation
Now we are ready to download the latest WordPress archive:
# cd /tmp && wget http://wordpress.org/latest.tar.gz
Make Directory each website create new Directory
# mkdir /var/www/wp-site
Next extract the archive in our web directory:
# tar -xvzf latest.tar.gz -C /var/www/wp-site
The above will create the following directory, which will contain our WordPress script:
Now change the ownership of that directory to user “apache”:
# chown -R apache /var/www/wp-site
Creating Apache Virtual Host for WordPress
We will create a separate virtual host for our WordPress install. Open /etc/httpd/conf/httpd.conf with your favorite text editor:
# vim /etc/httpd/conf/httpd.conf
And add the following code at the bottom of the file and replace the marked text with the information related to your installation:
<VirtualHost 184.108.40.206 <your-local-ip>:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/wp-site/wordpress ServerName neoistone.com ServerAlias www.neoistone.com ErrorLog /var/log/httpd/neoistone-error-log CustomLog /var/log/httpd/neoistone-acces-log common </VirtualHost>
Save your changes and restart Apache:
# systemctl restart httpd
Installing WordPress on Website
Now we are ready to run our WordPress installation. To start the installation you can access either your server’s IP address at
http://ip-address or if installing locally you can use
http://localhost or if you are using a real domain, you can use the domain instead. You should see the following page:
When you click on Let’s Go button, you will be redirected to the next page of the installation, where you will have to enter the database details we created earlier.
When you have enter the details, click the submit button. WordPress will attempt to create it’s configuration file called wp-config.php. If everything is fine you should see the following page:
Once you click the “Run the installation” button, you will be asked to enter some details about your website: Site Title, Username, Password and Email address.
When you have filled all the required information finalize the installation by clicking the button at the bottom. Your installation is now complete. Your front page should look something the image below:
And the WordPress dashboard looks as follows:
You can now start managing your WordPress website.
You have successfully completed the installation of WordPress using LAMP on CentOS 7. If you had any difficulties or questions, please submit them in the comment section below.