Top Poster
#1 ramon fincken 400
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 pEcosespedex 1
#8 khadish 1
#9 moxxx 1
#10 nistelrock 1
[apache] Enable self signed https certificate on your development server



Rating : 3 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
Beta
Want to be notified by email when this topic gets a reply?  
View previous topic :: View next topic  
Author Message
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 400
Location: A'dam/Diemen, The Netherlands

PostPosted: Mon Jan 20, 2014 9:56 am    Post subject: [apache] Enable self signed https certificate on your development server Reply with quote

Pre check;
install openssl

Now run
Code:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mysitename.key -out mysitename.crt


Code:
You will be prompted to enter your organizational information and a common name. The common name should be the fully qualified domain name for the site you are securing (www.mydomain.com). You can leave the email address, challenge password, and optional company name blank. When the command is finished running, it will create two files: a mysitename.key file and a mysitename.crt self signed certificate file valid for 365 days.

Install Your Self Signed Certificate

Now, you just need to configure your Apache virtual host to use the SSL certificate. If you only have one Apache virtual host to secure and you have an ssl.conf file being loaded, you can just edit that file. Otherwise, you will need to make a copy of the existing non-secure virtual host, paste it below, and change the port from port 80 to 443.

Open your Apache configuration file in a text editor. Depending on your operating system and Apache version, it will be located in different places but you will usually find it at /etc/httpd/httpd.conf. On a Windows machine, you will usually find it at C:\Program Files\Apache\Apache2\conf\httpd.conf
In most cases, you will find the <VirtualHost> blocks in a separate file in a directory like /etc/httpd/vhosts.d/ or /etc/httpd/sites/. Add the lines in bold below. <VirtualHost>

DocumentRoot /var/www/website
ServerName www.domain.com
SSLEngine on
SSLCertificateFile /etc/ssl/crt/primary.crt
SSLCertificateKeyFile /etc/ssl/crt/private.key
# SSLCertificateChainFile /etc/ssl/crt/intermediate.crt
</VirtualHost>

Change the names of the files and paths to match your certificate files. Save the changes and exit the text editor.
Restart your Apache web server using one of the following commands: /usr/local/apache/bin/apachectl startssl
/usr/local/apache/bin/apachectl restart




do not forget this
Code:
sudo a2enmod ssl



Sources:
http://www.sslshopper.com/article-how-t...icate.html
http://www.emreakkas.com/linux-tips/inv...ntu-server
Back to top
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Mon Jan 20, 2014 9:56 am    Post subject: [apache] Enable self signed https certificate on your development server

Advertisement
Back to top
GravityForms
Advertisement





PostPosted: Mon Jan 20, 2014 9:56 am    Post subject: [apache] Enable self signed https certificate on your development server

Advertisement
Gravity Forms Plugin for WordPress
Back to top
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads