LAMP服务器配置相关

Ubuntu快速安装lamp

apt-get -y install mariadb-server mariadb-client apache2 php7.2 libapache2-mod-php7.2 php7.2-mysql php7.2-curl php7.2-gd php7.2-intl php-pear php-imagick php7.2-imap php-memcache  php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-mbstring php-gettext  php7.2-opcache php-apcu php-zip php-mbstring php-xml php-xml-rpc2
mysql_secure_installation

apache虚拟主机配置文件

<VirtualHost *:80>
    ServerAdmin zuoridangnian@outlook.com
    DocumentRoot /var/www/zrdn/
    ServerName zuoridangnian.com
    <Directory /var/www/zrdn/>
        Options -Indexes
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Nginx

nginx 二级目录重写到二级域名:

rewrite ^/photo-gallery/(.*) http://photo.zuoridangnian.com/$1 permanent;