ตั้งค่าของ Apache
nano /etc/httpd/conf.d/phpMyAdmin.conf
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
Order Deny,Allow
Deny from All
Allow from All
Options FollowSymLinks
AllowOverride All
</Directory>
nano /etc/httpd/conf.d/roundcubemail.conf
Alias /roundcubemail /usr/share/roundcubemail
Alias /webmail /usr/share/roundcubemail
<Directory /usr/share/roundcubemail/>
Order Deny,Allow
Deny from all
Allow from all
Options FollowSymLinks
AllowOverride All
</Directory>
เพิ่มไฟล์ .htaccess
nano /usr/share/phpMyAdmin/.htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
nano /usr/share/roundcubemail/.htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
สำหรับ nginx เราไม่ต้องแก้ 2 ไฟล์นี้ เพราะงานหลัก ทำโดย apache แล้ว
/etc/nginx/conf.d/phpmyadmin.inc
/etc/nginx/conf.d/webmail.inc
9 ส.ค. 62