First, the directory structure:
/etc/apache2/
|--apache2.conf//Global configuration file
|--conf-available//config file
|--conf-enabled//Activated configuration file
|--Envvars
|--Magic
|--mods-available
|--mods-enabled
|--ports.conf
|--sites-available
'--sites-enabled
Two or three command a2enconf, A2enmod, A2ensite
The function is to connect the things in the available to the enabled
Third, create site ' sites-available/001-gzyinkaixuan.conf '
<virtualhost *:8080>
#ServerName www.example.com
ServerName localhost Specify your server name
#ServerAdmin [email protected]
Documentroot/home/www/site/pelican Specify the file location of your Web site
<directory "/home/www/site/pelican" >
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Errorlog "|/usr/bin/rotatelogs/home/www/log/error.log.%y-%m-%d-%h:%m:%s 5M"
Customlog "|/usr/bin/rotatelogs/home/www/log/access.log 3600" combined
</VirtualHost>
Iv. use A2ensite 001-gzyinkaixuan.conf to activate your site and then access
http://<yourip>:8080, please note that firewall ports are open
V. Additional
Default Firewall Policy:
*filter:input Accept [0:0]:forward Accept [0:0]:output Accept [0:0]# for established connections-i input-m State--state Established,related-j accept-a input-s 127.0.0.1/32-j accept-a input-s ${myip}-j accept-a input-p icmp-j ACCEPT# fo R ssh-a input-p tcp--dport <your ssh port>-j localnet# drop all-i input-j dropcommit
Debian 8 Apache2