sudo pacman -SyuOnce the update is complete, we can install Apache:
sudo pacman -S apacheAfter Apache is installed, we need to make a couple of changes in the configuration.
sudo nano /etc/httpd/conf/httpd.confComment out the unique_id_module (you can use ctrl w to find it quickly):
#LoadModule unique_id_module modules/mod_unique_id.soRestart Apache:
sudo systemctl restart httpdDuring the apache restart, you may get a notice that says the following:
httpd: apr_sockaddr_info_get() failed for panel1 httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [DONE]Although this alert does not interfere with the apache launch, you can easily eliminate it if you like by adding your hostname to your configuration.
sudo nano /etc/hostsAdd your hostname to the end of the line beginning with 127.0.0.1:
127.0.0.1 localhost.localdomain localhost panel1Subsequent restarts of Apache will no longer display that message.
sudo nano /srv/http/index.html
<html> <title>Welcome</title> <body> <h2>Hello, Welcome to Arch</h2> </body> </html>You can visit the placeholder page by going to your server’s IP address in your browser.
curl -s icanhazip.com
sudo pacman -S mysqlHit enter if it asks you anything, unless you know you don't want the defaults.
sudo systemctl start mysqldFinish up by running the MySQL set up script:
sudo mysql_secure_installationThe process will ask you for your current MySQL root password (not to be confused with your server password) and, since it has not yet been set, simply press enter.
By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up...Once you're done installing MySQL, finish the LAMP stack by installing PHP.
sudo pacman -S php php-apachePHP should also be added to the apache configuration file:
sudo nano /etc/httpd/conf/httpd.confPaste in this text block within the config.
# Use for PHP 5.x: LoadModule php5_module modules/libphp5.so AddHandler php5-script php Include conf/extra/php5_module.conf
sudo nano /srv/http/info.phpAdd in the following line:
<?php phpinfo(); ?>Then Save and Exit.
sudo systemctl restart httpdVisit your php info page (make sure you replace the example ip address with your correct one): http://12.34.56.789/info.php
sudo systemctl enable mysqld httpdCongratulations, you have now installed the LAMP server on Arch Linux!
Article ID: 213
Created On: Fri, Dec 27, 2013 at 4:08 AM
Last Updated On: Sun, Jan 5, 2014 at 8:08 PM
Authored by: ASPHostServer Administrator [asphostserver@gmail.com]
Online URL: http://faq.asphosthelpdesk.com/article.php?id=213