Showing posts with label Apache2. Show all posts
Showing posts with label Apache2. Show all posts

Friday, August 5, 2016

Cấu hình chuyển Http Sang Http Qua Apache2


<VirtualHost *:80>
 ServerName yourdomain.com
</VirtualHost>

<VirtualHost *:443>
 DocumentRoot "/var/www/html/..."
 ServerName yourdomain.com
</VirtualHost>
Read More

Thursday, July 7, 2016

Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster. Error 403

a

Access forbidden!


You don't have permission to access the requested directory.
There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.

Error 403

Đây là file config mẫu để bạn kiểm thử.

<VirtualHost 127.0.0.x:80>
    ServerAdmin info@longliulo.co
    DocumentRoot "/path/to/your/folder"
    ServerName yourdomain.com
 <Directory "/path/to/your/folder">
                Allow from all
                AllowOverride All
                Order Allow,Deny
                Require all granted
    </Directory>
    ErrorLog "logs/yourdomain.com.dummy-host2.example.com-error.log"
    CustomLog "logs/yourdomain.com.dummy-host2.example.com-access.log" common
</VirtualHost>

Read More

Friday, July 1, 2016

Tạo https cho tên miền trên Ubuntu với web server Apache2

Tạo https cho tên miền trên Ubuntu với web server Apache2
Tạo https cho tên miền trên Ubuntu với web server Apache2

#Bật Secure Sockets Layer của apache2
a2enmod ssl

#Khởi động apache2
service apache2 restart

#Tạo thư mục chứa ssl
mkdir /etc/apache2/ssl

#Tạo tập tin xác thực
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/domain.key -out /etc/apache2/ssl/domain.crt

#Thêm vào /etc/apache2/sites-enabled/domain.conf
<VirtualHost *:443>
ServerName domain.com

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/domain.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain.key
</VirtualHost *:443>

#Khởi động apache2
service apache2 restart
Read More