树莓派安装LAMP配置【2】-虚拟目录设置

Apache2的配置目录文件是:

/etc/apache2/sites-available/default

然后sudo nano [file]编辑(建议先备份)

<VirtualHost *:80>
#    ServerAdmin webmaster@localhost
    ServerAdmin root@xxoo.org

#    DocumentRoot /var/www
    DocumentRoot /home/pi/wwwroot/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
#    <Directory /var/www/>
    <Directory /home/pi/wwwroot/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

我只是更改了原先的一些配置而已,具体配置直接搜索即可~~包括域名绑定神马的

原文地址:https://www.cnblogs.com/ch3rry/p/3898554.html