Debian 6.0.6 Server Apache2 :Auto redirect http to https -third (see Description below)
viafreekab:
All commands and configurations files Apache2 (auto redirect https) :
apt-get install apache2
apache2 -v
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sudo a2enmod ssl
service apache2 force-reload or /etc/init.d/apache2 force-reload
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-Install certification
apt-get install ssl-cert
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem
sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/apache2/server.crt -keyout /etc/apache2/server.key
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cd /etc/apache2/sites-available/
sudo cp default ssl
sudo sed -i '1,2s/\*:80/*:443/' ssl
sudo sed -i "3a\\\tSSLEngine On\n\tSSLCertificateFile /etc/ssl/private/localhost.pem" ssl
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a2ensite ssl
Modification index.html
nano /var/www/index.html
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/etc/init.d/apache2 reload
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 Solution : (auto redirect http to https)
nano /etc/apache2/sites-enabled/000-default
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 Solution (you must add (s) manually to http):no auto redirect
Edit :nano /etc/apache2/ports.conf---add listen 443
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem restarting APACHE2
error;
root@viafreekab:/etc/apache2/sites-available# sudo /etc/init.d/apache2 reload
Syntax error on line 4 of /etc/apache2/sites-enabled/ssl:Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
Solution:
a2enmod ssl
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
error:
root@viafreekab:/etc/apache2/sites-available# sudo /etc/init.d/apache2 reload
Syntax error on line 41 of /etc/apache2/sites-enabled/000-default:Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
Did you ensure the RewriteEngine is on?
Solution:
You'll want to verify that the mod is enabled - just look for rewrite.load symlink in /etc/apache2/mods-enabled. If not, run sudo a2enmod rewrite to enable it. Restart apache using sudo service apache2 restart and provided your .htaccess syntax is correct this will work.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem :
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Solution:
sudo sh -c 'echo "ServerName localhost" PLEASE ADD DOUBLE BRACKET HERE (Brackets aren't allowed in description) /etc/apache2/conf.d/name' && sudo service apache2 restart
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Logs:
/var/log/apache2/access.log : logs web server connection
/var/log/apache2/error.log : all errors
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
check ports:
cat /etc/apache2/ports.conf
Видео Debian 6.0.6 Server Apache2 :Auto redirect http to https -third (see Description below) канала Viafreekab
All commands and configurations files Apache2 (auto redirect https) :
apt-get install apache2
apache2 -v
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sudo a2enmod ssl
service apache2 force-reload or /etc/init.d/apache2 force-reload
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-Install certification
apt-get install ssl-cert
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem
sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/apache2/server.crt -keyout /etc/apache2/server.key
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cd /etc/apache2/sites-available/
sudo cp default ssl
sudo sed -i '1,2s/\*:80/*:443/' ssl
sudo sed -i "3a\\\tSSLEngine On\n\tSSLCertificateFile /etc/ssl/private/localhost.pem" ssl
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a2ensite ssl
Modification index.html
nano /var/www/index.html
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/etc/init.d/apache2 reload
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 Solution : (auto redirect http to https)
nano /etc/apache2/sites-enabled/000-default
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 Solution (you must add (s) manually to http):no auto redirect
Edit :nano /etc/apache2/ports.conf---add listen 443
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem restarting APACHE2
error;
root@viafreekab:/etc/apache2/sites-available# sudo /etc/init.d/apache2 reload
Syntax error on line 4 of /etc/apache2/sites-enabled/ssl:Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
Solution:
a2enmod ssl
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
error:
root@viafreekab:/etc/apache2/sites-available# sudo /etc/init.d/apache2 reload
Syntax error on line 41 of /etc/apache2/sites-enabled/000-default:Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
Did you ensure the RewriteEngine is on?
Solution:
You'll want to verify that the mod is enabled - just look for rewrite.load symlink in /etc/apache2/mods-enabled. If not, run sudo a2enmod rewrite to enable it. Restart apache using sudo service apache2 restart and provided your .htaccess syntax is correct this will work.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem :
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Solution:
sudo sh -c 'echo "ServerName localhost" PLEASE ADD DOUBLE BRACKET HERE (Brackets aren't allowed in description) /etc/apache2/conf.d/name' && sudo service apache2 restart
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Logs:
/var/log/apache2/access.log : logs web server connection
/var/log/apache2/error.log : all errors
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
check ports:
cat /etc/apache2/ports.conf
Видео Debian 6.0.6 Server Apache2 :Auto redirect http to https -third (see Description below) канала Viafreekab
Комментарии отсутствуют
Информация о видео
14 января 2016 г. 12:53:30
00:09:36
Другие видео канала