step 0
Please run apt-get update and apt-get upgrade first.
step 1 Install Apache
sudo apt-get install apache2
note: The default config file is
/etc/apache2/site-available/000-default.conf, and the content may be
ServerName abc.com
ServerAlias www.abc.com
<Directory /var/www/html/xxx/>
AllowOverride All
</Directory>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/xxx
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
You can use your domain name instead of 'abc' and your web directory can take replace of 'xxx'.
- Test
http://localhostin your browser.
step 2 Install PHP
sudo apt-get install php7.0sudo apt-get install libapache2-mod-php7.0service apache2 reload
step 3 Install MySQL
-
apt-get install mysql-server mysql-clientYou should enter you root psw in this step.
service mysql stop/restart/start
Finally, the default web root directory is
/var/www/html
