This tutorial shows how to set up Apache, PHP and MariaDB (drop-in replacement for MySQL). You can use pacman instead of yaourt on installing the server, since yaourt doesn't come with Arch in default. Although I suggest yaourt, it includes packages from user repository. I have found every single piece of software that I need from there(xmind, drush, netbeans), also it will keep them up to date.
Apache
Open up your terminal and install Apache by these commands.
Uncomment and change ServerName. After you have restarted httpd then you can create an index.html and write something in it to test if it works on localhost.Source code viewer
# Log in as root. su - # Run update and upgrade. yaourt -Syua # Install apache. yaourt -S apacheProgramming Language: Bash
Source code viewer
vim /etc/httpd/conf/httpd.conf # Change "#ServerName www.example.com:80" to "ServerName localhost:80". systemctl restart httpdProgramming Language: Bash
PHP
Continue with PHP installation by using these commands.
Source code viewer
# Install PHP. yaourt -S php # Install Apache SAPI for PHP. yaourt -S php-apache vim /etc/httpd/conf/httpd.conf # Uncomment "LoadModule rewrite_module modules/mod_rewrite.so". # Place this in the end of LoadModules: "LoadModule php5_module modules/libphp5.so". # Place this in the end of Includes: "Include conf/extra/php5_module.conf". # Place this in the top of "Include conf/extra/php5_module.conf": "AddHandler php5-script php". # Comment out "LoadModule mpm_event_module modules/mod_mpm_event.so". # Add "LoadModule mpm_prefork_module modules/mod_mpm_prefork.so" after the commented line. systemctl restart httpdProgramming Language: Bash
MariaDB
Continue with MariaDB installation by using these commands.
Source code viewer
# Install MySQL or an alternative. yaourt -S mysqlProgramming Language: Bash
Source code viewer
vim /etc/php/php.ini # Uncomment "extension=pdo_mysql.so" and "extension=mysqli.so". systemctl restart httpd systemctl restart mysqldProgramming Language: Bash