Every time I’ve tried to install Wordpress on Arch Linux it was a tragedy. Sometimes a configuration was missing, sometimes stuff not well known was broken and I never found an updated and complete guide. So here you are!
In all the following commands I’ve omitted “sudo”. Please use it when it is necessary.
Before starting make you sure that all the packages are updated.
First of all, you need to install and configure Apache, the web server.
After the installation you have to start Apache and if you want you can set the auto-start at boot time with the enable command.
At this point you have to change some configurations of Apache. In order to do that, you can use your preferred editor like nano or vim. I’ll use nano. (If you aren’t a nano user here’s some tip: to search a string you have to press ctrl+w; to exit you have to press ctrl+x and type ‘y’ or ‘n’ in order to save or not the file. Remember that the saving process can give an error if the file isn’t opened as root and only the root user can edit it).
So open the httpd.conf file
and uncomment (remove the #) the following string.
At this point you have to restart Apache to apply the changes.
To make sure that all is correctly set and Apache is working you have to simply write an html file and put it into the /srv/http folder. So you can use again nano
to write this simple html file.
Now open your broswer and go to http://localhost. If everything is up and running you should see a page like this:
Now it is the time to install PHP with the following command.
As you can image, you need to configure some stuff. Open again with your preferred editor the httpd.conf file:
comment (add a ‘#') this line
and uncomment (remove the ‘#') this one.
Finally you have to add these lines at the bottom of the file.
Now it’s the time to configure the php.ini. Open the file
and uncomment (remove the ‘;') the following lines.
Now PHP (should be) is correctly set. To check if all is working, you can write a simple info page inside srv/http/. Open the editor,
write the following line
and restart the httpd service.
Now, if you open your broswer and you go to http://localhost/info.php, you should see a page like this:
Install Maria DB
Now you have to install and create the database. You are going to install Maria DB, the implementation of MySQL for Arch Linux.
After the installation you have to set some base configuration with this command.
As you guess, you need to start and enable the service.
Before creating the database, you have to set the root password and some other configurations. You can do it with this command
Finally now you can create your own database. Connect to the MySQL console with this command.
After you type the password, you can start to create the database. Of course you can change the name of the database and the user.
FINALLY it’s time to install Wordpress inside the /srv/http folder.
Now you have to change the ownership of the folder wordpress to the http group.
The last step is to create the Wordpress config file starting from the default one.
All you have to do is opening the file
and set the name of the database, the user and the password.
Now everything is done. To check if it is true, open the broswer and go to http://localhost/wordpress and you should see a page like this.
Now you can go through the classic setup of Wordpress. Enjoy it!