Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2661  / 1 Year ago, fri, december 2, 2022, 7:35:55

I saw some similar posts like this , but it didn't help me at my exact problem.
So I am using ubuntu 12.04 on a server with apache2 on it. There are like 5 websites which are Virtualhosts and Namebased running on it (using the same port). Now I need another page whiche REQUIRES a SSL certificate.
Is it possible to run just the one page under ssl or do I automatically load everything in it when I configure SSL ?



I know that I have to put the SSL server under Port 443 like this :



<virtualhost *:443>
SSLEngine On
SSLCertificateFile /path/to/your/sslcert
DocumentRoot /path/your/webcontent
</virtualhost>


Does anyone know and want to explain me, how to setup ssl for just one page?


More From » 12.04

 Answers
4

solved.



first of all check your hostname by entering



hostname  (you will need it later)


enable ssl-mod



sudo a2enmod ssl


guide from scratch :



Create folder for ssl certificate and key



sudo mkdir /etc/apache2/ssl 


create .key file and .crt file and after that load both apache2...



sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt


when you enter all the details for the certificate make sure that you have the same common name as your hostname , otherwise you will get a warning in your apache2 log for not having the right hostname. (not neccessary, but better to avoid this)



your ssl will only run under port 443 so you need to put the listener 443 to ports.conf in your apache dir by adding Listen 443



than create your ssl page under sites-available



sudo nano /etc/apache2/sites-available/ssl



<virtualhost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
DocumentRoot /var/www/yourlink
</virtualhost>


load the page by sudo a2ensite ssl



sudo service apache2 reload


now it will only SSL secure my yourlink folder.


[#29217] Friday, December 2, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byishted

Total Points: 469
Total Questions: 113
Total Answers: 113

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
;