615Chapter 23Running a (Starting a web site) Linux, Apache, MySQL, and PHP

615Chapter 23Running a Linux, Apache, MySQL, and PHP (LAMP) ServerThe Common Name should match the name that clients will use to accessyour server. Be sure to get the other details right if you plan to have the CSRsigned by a third-party CA. 5.When using a third-party CA, submit the CSR to it and then place the certificateit provides you into /etc/apache/ssl.crt/server.crt(or a different file, as desired). 6.If you don t plan to have your certificate signed, or if you want to test yourconfiguration, generate a self-signed certificate and save it in a file namedserver.crt: # cd ../ssl.crt/ # openssl req new -x509 -nodes -sha1 -days 365 -key../ssl.key/server.key -out server.crtCountry Name (2 letter code) [AU]:. State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits PtyLtd]:TEST USE ONLYOrganizational Unit Name (eg, section) []:TEST USE ONLYCommon Name (eg, YOUR name) []:secure.example.orgEmail Address []:dom@example.orgConfiguring Apache to Support SSL/TLSOnce your keys have been generated, you will need to install the mod_ssl Apachemodule, which adds SSL/TLS support to Apache and then configure it using theappropriate configuration directives. Here s how: 1.SSL and TLS support can be added to Apache by installing the mod_ssl package: # apt-get install libapache-mod-ssl# apache-modconf apache enable mod_sslReplacing config file /etc/apache/modules.conf with newversion2.Add an SSL-enabled virtual host to your Apache configuration files. Usingtheearlier virtual host as an example, your configuration will look somethinglike this: Listen *:443 ServerName secure.example.orgDocumentRoot /home/username/public_html/ User usernameGroup groupnameDirectoryIndex index.php index.html index.htmSSLEngine OnSSLCertificateKeyFile /etc/apache/ssl.key/server.keySSLCertificateFile /etc/apache/ssl.crt/server.crtSSLCACertificateFile /etc/apache/ssl.crt/ca.crt
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Leave a Reply