Pages:
Author

Topic: Anyone help me with SSL (CLOSED) (Read 959 times)

legendary
Activity: 2254
Merit: 1140
May 09, 2015, 01:18:33 AM
#21
closed,

I am not clever enough, I have been on it two weeks and made Major stupid mistakes, and my site is not popular enough to do this every year.

I have nearly lost my site due to my errors, no one wants my money, so I will just cloud my site with free SSL

discretion is the better part of valor.

Thanks all

Squall, I know I dont have high trust like required by your post but if you want we could do it through a teamviewer session so you wouldnt have to give me any passwords and you can watch everything I am doing.   I have set up a ton of Comodo certs before.  PM me if you are interested.
copper member
Activity: 2310
Merit: 1032
May 08, 2015, 10:25:48 AM
#20
closed,

I am not clever enough, I have been on it two weeks and made Major stupid mistakes, and my site is not popular enough to do this every year.

I have nearly lost my site due to my errors, no one wants my money, so I will just cloud my site with free SSL

discretion is the better part of valor.

Thanks all
copper member
Activity: 2310
Merit: 1032
May 08, 2015, 05:04:09 AM
#19

Squall, what is a little tricky is that the intermediate certificates need to be combined in exactly the right order.  I'm not sure which particular Comodo cert you have, but mine had three intermediates.    Take a look here: https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/643/17/

Yes, I have the same, I managed to compile fine using cat command.



sudo is used to execute commands as another user. It's used on servers where root login is disabled and instead people login as an unprivileged user and use sudo to execute commands as root user.

In your case since you are already logged in as root you can omit the use of sudo.

Commodo has some excellent documentation that you should refer to instead of asking on random forums for help:

https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/637/37/certificate-installation-apache--mod_ssl

If you need someone to install it for you then PM me and I'll do it for a reasonable fee.

Thats a little beyond me, How does that work? As I have root access but still need sudo to run certain commands to get this job done?

whats your idea of a reasonable fee  Grin
legendary
Activity: 2254
Merit: 1140
May 08, 2015, 12:51:53 AM
#18
Hiya all, Sorry, but this is strictly high trust longstanding members only. It's not much but it's my site, I will reset all passwords after use.

I might consider someone guiding me step by step.

Basically, I am installing an SSL cert on apache2 server, I have generated CSR and received the four comodo files and made the server.crt file, But thats where I am stuck, I dont know where it goes or how to activate it on the VPS.

No I will not use a cloud.

Let me know what your price is.

Squall, what is a little tricky is that the intermediate certificates need to be combined in exactly the right order.  I'm not sure which particular Comodo cert you have, but mine had three intermediates.    Take a look here: https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/643/17/
legendary
Activity: 3710
Merit: 1586
May 07, 2015, 07:19:15 PM
#17
I just installed it so now its:-

Code:
root@Squall:/# whereis sudo
sudo: /usr/bin/sudo /usr/lib/sudo /usr/share/man/man8/sudo.8.gz
root@Squall:/#

sudo is used to execute commands as another user. It's used on servers where root login is disabled and instead people login as an unprivileged user and use sudo to execute commands as root user.

In your case since you are already logged in as root you can omit the use of sudo.

Commodo has some excellent documentation that you should refer to instead of asking on random forums for help:

https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/637/37/certificate-installation-apache--mod_ssl

If you need someone to install it for you then PM me and I'll do it for a reasonable fee.
hero member
Activity: 576
Merit: 514
May 07, 2015, 02:41:53 PM
#16
Every web dev who wants some sort of SSL has to go through this  Roll Eyes Geeez Louise!

There no easier way?  Tongue

K give me some time, I will do this later when I am set up mentally  Undecided
That's why I only run CentOS/RHEL on all my servers and admin them via SSH only.
Never understood why Debian/Ubuntu would do crap like symlinking configs.
legendary
Activity: 1143
Merit: 1000
May 07, 2015, 01:44:20 PM
#15
When I've any issue with my linux box I usually check the arch linux wiki, it should apply to the latest updated linux distro and would only vary if ubuntu uses some different files for configuration (this might be the case); Take a read on https://wiki.archlinux.org/index.php/Apache_HTTP_Server and see if you can find anything there

the exact part regarding ssl

Code:
To use TLS/SSL, you will need to install openssl.
Create a private key and certificate signing request (CSR) and optionally self-sign the CSR (which creates a certificate):
Note: You may want to change the key size in bits (rsa_keygen_bits:2048), remove -sha256 to use SHA-1 instead of SHA-2, or change the number of days of validity (-days 365).
# cd /etc/httpd/conf
# openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out server.key
# chmod 600 server.key
# openssl req -new -sha256 -key server.key -out server.csr
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Then, in /etc/httpd/conf/httpd.conf, uncomment the following three lines:
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
Include conf/extra/httpd-ssl.conf
Warning: Some variations and implementations of SSL and TLS are vulnerable to attack. Mozilla has a useful SSL/TLS article which includes Apache specific configuration guidelines as well as an automated tool to help create a more secure configuration.
Restart httpd.service to apply any changes.
sr. member
Activity: 387
Merit: 264
May 07, 2015, 01:30:42 PM
#14
-snip-

Code:
sudo rm -rf /etc/apache2/sites-enabled/{the weird directory you mentioned}

^ make sure you verify the path. you don't want to accidentally delete the wrong directory.
 -snip-

I highly recommend you to copy all the files in 'sites-enabled' before you try to run the above command. Using -a when running cp command is recommended.

if one follows the standards for setting up a vhost in ubuntu there shouldn't be anything in that directory except for symbolic links to config files located in sites-available.
copper member
Activity: 2310
Merit: 1032
May 07, 2015, 01:27:15 PM
#13
Every web dev who wants some sort of SSL has to go through this  Roll Eyes Geeez Louise!

There no easier way?  Tongue

K give me some time, I will do this later when I am set up mentally  Undecided
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
May 07, 2015, 01:19:33 PM
#12
-snip-

Code:
sudo rm -rf /etc/apache2/sites-enabled/{the weird directory you mentioned}

^ make sure you verify the path. you don't want to accidentally delete the wrong directory.
 -snip-

I highly recommend you to copy all the files in 'sites-enabled' before you try to run the above command. Using -a when running cp command is recommended.
sr. member
Activity: 387
Merit: 264
May 07, 2015, 11:43:10 AM
#11
Did you check if there is any typos in site's name in the command?

yes, The ghost file that I found that leads to nowhere did start off 000-www.mysite.conf I tried this aswell but nothing, I cant do anything with this "ghost" file, I cand move/del/edit nothing, I'm stumped.  I use filezilla BTW, so I see it as a windows directory would show it, any I run command with putty.

That ghost file is a symbolic link to some other file which may or may not exist(im guessing?). Your vhost should be in /etc/apache2/sites-available and the "a2ensite" script simply creates a symbolic link for it in /etc/apache2/sites-enabled.


If I were you I would just start over. Here is a step by step command list:

remove the current symbolic link
Code:
sudo unlink /etc/apache2/sites-enabled/{Your old vhost}.conf

or

Code:
sudo rm -rf /etc/apache2/sites-enabled/{the weird directory you mentioned}

^ make sure you verify the path. you don't want to accidentally delete the wrong directory.

copy the default ssl vhost in /etc/apache2/sites-available/default-ssl.conf:
Code:
sudo cp /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/001-yourdomain.conf

uncomment/edit the relevant paths in your new 001-yourdomain.conf(DocumentRoot,  SSLCertificateFile, SSLCertificateKeyFile, etc)
Code:


ServerAdmin webmaster@localhost

DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   A self-signed (snakeoil) certificate can be created by installing
#   the ssl-cert package. See
#   /usr/share/doc/apache2/README.Debian.gz for more info.
#   If both key and certificate are stored in the same file, only the
#   SSLCertificateFile directive is needed.
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

#   Server Certificate Chain:
#   Point SSLCertificateChainFile at a file containing the
#   concatenation of PEM encoded CA certificates which form the
#   certificate chain for the server certificate. Alternatively
#   the referenced file can be the same as SSLCertificateFile
#   when the CA certificates are directly appended to the server
#   certificate for convinience.
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

#   Certificate Authority (CA):
#   Set the CA certificate verification path where to find CA
#   certificates for client authentication or alternatively one
#   huge file containing all of them (file must be PEM encoded)
#   Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath /etc/ssl/certs/
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

#   Certificate Revocation Lists (CRL):
#   Set the CA revocation path where to find CA CRLs for client
#   authentication or alternatively one huge file containing all
#   of them (file must be PEM encoded)
#   Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath /etc/apache2/ssl.crl/
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

#   Client Authentication (Type):
#   Client certificate verification type and depth.  Types are
#   none, optional, require and optional_no_ca.  Depth is a
#   number which specifies how deeply to verify the certificate
#   issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth  10

#   SSL Engine Options:
#   Set various options for the SSL engine.
#   o FakeBasicAuth:
# Translate the client X.509 into a Basic Authorisation.  This means that
# the standard Auth/DBMAuth methods can be used for access control.  The
# user name is the `one line' version of the client's X.509 certificate.
# Note that no password is obtained from the user. Every entry in the user
# file needs this password: `xxj31ZMTZzkVA'.
#   o ExportCertData:
# This exports two additional environment variables: SSL_CLIENT_CERT and
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
# server (always existing) and the client (only existing when client
# authentication is used). This can be used to import the certificates
# into CGI scripts.
#   o StdEnvVars:
# This exports the standard SSL/TLS related `SSL_*' environment variables.
# Per default this exportation is switched off for performance reasons,
# because the extraction step is an expensive operation and is usually
# useless for serving static content. So one usually enables the
# exportation for CGI and SSI requests only.
#   o OptRenegotiate:
# This enables optimized SSL connection renegotiation handling when SSL
# directives are used in per-directory context.
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

SSLOptions +StdEnvVars


SSLOptions +StdEnvVars


#   SSL Protocol Adjustments:
#   The safe and default but still SSL/TLS standard compliant shutdown
#   approach is that mod_ssl sends the close notify alert but doesn't wait for
#   the close notify alert from client. When you need a different shutdown
#   approach you can use one of the following variables:
#   o ssl-unclean-shutdown:
# This forces an unclean shutdown when the connection is closed, i.e. no
# SSL close notify alert is send or allowed to received.  This violates
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
# this when you receive I/O errors because of the standard approach where
# mod_ssl sends the close notify alert.
#   o ssl-accurate-shutdown:
# This forces an accurate shutdown when the connection is closed, i.e. a
# SSL close notify alert is send and mod_ssl waits for the close notify
# alert of the client. This is 100% SSL/TLS standard compliant, but in
# practice often causes hanging connections with brain-dead browsers. Use
# this only for browsers where you know that their SSL implementation
# works correctly.
#   Notice: Most problems of broken clients are also related to the HTTP
#   keep-alive facility, so you usually additionally want to disable
#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
#   "force-response-1.0" for this.
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown




# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
3) enable the domain
Code:
sudo a2ensite 001-yourdomain.conf

I know this is probably like reading greek(assuming you don't read greek Tongue) right now but ubuntu really makes it a breeze to run a basic lamp setup once you figure it out.

edit
if you would like I can walk you through this on a teamviewer session or something.
copper member
Activity: 2310
Merit: 1032
May 07, 2015, 09:13:33 AM
#10
Did you check if there is any typos in site's name in the command?

yes, The ghost file that I found that leads to nowhere did start off 000-www.mysite.conf I tried this aswell but nothing, I cant do anything with this "ghost" file, I cand move/del/edit nothing, I'm stumped.  I use filezilla BTW, so I see it as a windows directory would show it, any I run command with putty.
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
May 07, 2015, 09:05:42 AM
#9
Did you check if there is any typos in site's name in the command?

P.S. What are you getting when you run whereis ?
copper member
Activity: 2310
Merit: 1032
May 07, 2015, 08:54:15 AM
#8
my site is not in /etc/apache2/sites-enabled/ but there is a folder with the site name on that is a shortcut link to somewhere, but I cant open or goto the link.

I run sudo a2ensite "sitename" but it returns with "sitename" does not exist.


Just so you know, I am following this guide.

https://www.digicert.com/ssl-certificate-installation-ubuntu-server-with-apache2.htm

I am at step 2, I just cant find the file to edit, or create it.
copper member
Activity: 2310
Merit: 1032
May 07, 2015, 08:47:38 AM
#7
I just installed it so now its:-

Code:
root@Squall:/# whereis sudo
sudo: /usr/bin/sudo /usr/lib/sudo /usr/share/man/man8/sudo.8.gz
root@Squall:/#
copper member
Activity: 2310
Merit: 1032
May 07, 2015, 08:40:57 AM
#6


RE: sudo not found

Can you post the output of the following?:
Code:
whereis sudo

Code:
root@Squall:~# whereis sudo
sudo:
root@Squall:~#
sr. member
Activity: 387
Merit: 264
May 06, 2015, 04:53:02 PM
#5
1) copy the default vhost in /etc/apache2/sites-available/default-ssl.conf:

Code:
sudo cp /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/001-yourdomain.conf

2)make the edits mentioned previously by Bitsky - just edit the relevant paths in your new 001-yourdomain.conf

3) enable the domain
Code:
sudo a2ensite 001-yourdomain.conf

RE: sudo not found

Can you post the output of the following?:
Code:
whereis sudo
hero member
Activity: 576
Merit: 514
May 06, 2015, 02:15:32 PM
#4
Not an Ubuntu user myself, but on Redhat you can get vhost information by running "httpd -S"; could be "apache2ctl -S" on Ubuntu.

copper member
Activity: 2310
Merit: 1032
May 06, 2015, 02:00:12 PM
#3
That should get you started

Code:

ServerName example.net
ServerAlias www.example.net
Redirect permanent / https://www.example.net/


ServerName example.net
ServerAlias www.example.net
DocumentRoot /var/www/example.net/
SSLEngine On
SSLCertificateFile /etc/httpd/ssl.d/example.net.crt
SSLCertificateKeyFile /etc/httpd/ssl.d/example.net.key
SSLCACertificateFile /etc/httpd/ssl.d/intermediate.crt


too far ahead, I am at this point


Find the Apache config file to edit.

Ubuntu's Apache configuration file for your ssl site is typically found in /etc/apache2/sites-enabled/your_site_name. If it is not found in the 'sites-enabled' folder, you would need to run the command sudo a2ensite your_site_name.

my site is not under the sites-enabled and the sudo command does not work "command not found"
hero member
Activity: 576
Merit: 514
May 06, 2015, 11:46:13 AM
#2
That should get you started

Code:

ServerName example.net
ServerAlias www.example.net
Redirect permanent / https://www.example.net/


ServerName example.net
ServerAlias www.example.net
DocumentRoot /var/www/example.net/
SSLEngine On
SSLCertificateFile /etc/httpd/ssl.d/example.net.crt
SSLCertificateKeyFile /etc/httpd/ssl.d/example.net.key
SSLCACertificateFile /etc/httpd/ssl.d/intermediate.crt

Pages:
Jump to: