LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-01-2011, 07:30 PM   #1
chanjay
LQ Newbie
 
Registered: Jun 2011
Posts: 13

Rep: Reputation: Disabled
http not working - https working.


Hi,

I just installed SSL certificate (Verisign) on my Apache webserver. Everything works perfectly under https but not regular http. Some pages that use http will not be displayed.

Any idea? Please help!

Thanks.

hc.
 
Old 06-01-2011, 07:37 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
Check in your apache error log. In most installations is it is a location like /var/log/httpd or /var/log/apache and then the log file will be error.log. This should give you a clear indication of why it did not resolve the page.

Without knowing the error message, it is nearly impossible to guess as to what the problem could be.
 
Old 06-01-2011, 07:49 PM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
did you create a separate virtual host for both http (port 80) and https (port 443) ? both should be pointing at the same document root but the one with 443 should be configured to use the certificates and serve on port 443, the other shouldn't be configured to use any certificates and serve on port 80.
 
Old 06-01-2011, 08:12 PM   #4
chanjay
LQ Newbie
 
Registered: Jun 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hi thanks for the replies,

I checked the error log (/etc/httpd/logs) and looks like there are no errors there.

I have 2 name-based host (domain1 and domain2) sharing same IP address, but the secured one is domain2.

Here are what is in my httpd.conf

Code:
Listen 80
.
.
.
<VirtualHost *>
        ServerSignature email
        DirectoryIndex index.htm index.html index.shtml index.php index.php4 index.php3 index.cgi
        LogLevel  warn
        HostNameLookups off
</VirtualHost>

<VirtualHost 12.34.56.78:80>
     ServerAdmin webmaster@domain1.com
     DocumentRoot /var/www/domain1/
     ServerName www.domain1.com
     ErrorLog logs/domain1.com-error_log
     CustomLog logs/domain1.com-access_log common
</VirtualHost>

<VirtualHost 12.34.56.78:80>
     ServerAdmin webmaster@domain2.com
     DocumentRoot /var/www/domain2/
     ServerName www.domain2.com
     ErrorLog logs/domain2-error_log
     CustomLog logs/domain2-access_log common
Redirect permanent / https://www.domain2.com
</VirtualHost>

<VirtualHost 12.34.56.78:80>
     ServerAdmin webmaster@domain1.com
     DocumentRoot /var/www/domain1/
     ServerName domain1.com
     ErrorLog logs/domain1.com-error_log
     CustomLog logs/domain1.com-access_log common
Redirect permanent / http://www.domain1.com
</VirtualHost>

<VirtualHost 12.34.56.78:80>
     ServerAdmin webmaster@domain2.com
     DocumentRoot /var/www/domain2/
     ServerName domain2.com
     ErrorLog logs/domain2-error_log
     CustomLog logs/domain2-access_log common
Redirect permanent / https://www.domain2.com
</VirtualHost>

<VirtualHost _default_:*>
     ServerAdmin webmaster@domain1.com
     DocumentRoot /var/www/domain1/
     ServerName www.domain1.com
     ErrorLog logs/domain1.com-error_log
     CustomLog logs/domain1.com-access_log common
</VirtualHost>
Here are what is in my ssl.conf

Code:
Listen 443
.
.
.
<VirtualHost www.domain2.com:443>
DocumentRoot "/var/www/domain2/"
ServerName www.domain2.com
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!
SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOWULL
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SSLCertificateChainFile /etc/httpd/conf/ssl.crt/intermediate.crt
SSLCACertificateFile /etc/httpd/conf/ssl.crt/intermediate.crt
<Location/>
</Location>
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>
 
Old 06-02-2011, 05:18 AM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
I realize that you tried to sanitize your post against putting your real domain or address in your response, but you need to double check your httpd.conf because you have four hosts listed as <VirtualHost 12.34.56.78:80> with different document roots and it looks like you have duplicates. My understanding of Apache is that you have the choice of using NameVirtualHost or IP identified virtual hosts. If you are identifying the hosts with the IP address and they all have the same IP address, it will pick the first one that matches. Instead you should try using *:80 in the virtual host declaration and declare NameVirualHost *:80, somewhere like the top of your httpd.conf. Traditionally, this won't work with secured sites, but if you only have one, it is a non issue.
 
Old 06-02-2011, 12:44 PM   #6
chanjay
LQ Newbie
 
Registered: Jun 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hi Noway2,

Thanks for the response...my boss didn't want me to expose the real company info here. Anyways, the httpd.conf was actually setup by the previous people who worked here before, with couple name-based virtual hosts (not IP identified) sharing the same IP address. I guess from my understanding, the virtual host duplicate purposes are for redirecting, for example "www.domain1.com" & "domain1.com" to "https://www.domain1.com".

I had tried to replace all <VirtualHost 12.34.56.78:80> with <VirtualHost *:80> and also Name VirtualHost *.80, then restart the httpd. I got "Error establising a database connection" on domain1 but domain2 still working with https.

hc.
 
Old 06-02-2011, 01:54 PM   #7
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
Quote:
I got "Error establising a database connection" on domain1 but domain2 still working with https.
Domain1 and Domain2 are using different document roots with different source paths right? The error message sounds like you have a SQL backend to your web server and something is configured wrong in the database connection. Normally, in the scripting language, you will have a connection string with the user name, database, and password. I would double check that all of this is the same for both as it sounds like Domain1 is not able to establish the connection for some reason. Searching through the code for that particular error message should show you right where the connection is being attempted and failing too.
 
Old 06-02-2011, 01:57 PM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I think that the error message "Error establising a database connection" is not pointing to an apache problem. It might be indicating that the website no longer can connect the database; time to look in the PHP files to see how it exactly works.

PS Noway2 beat me to it

Last edited by Wim Sturkenboom; 06-02-2011 at 01:59 PM.
 
Old 06-02-2011, 02:12 PM   #9
chanjay
LQ Newbie
 
Registered: Jun 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Domain1 site is actually just plain simple html & css with no database involved. This is strange, it is working on NameVirtualHost 12.34.56.78:80 & <VirtualHost 12.34.56.78:80> but not NameVirtualHost *:80 & <VirtualHost *:80>.

hc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache: http://localhost (work) http://ipaddress (not working) sarmad Linux - Newbie 7 02-05-2013 08:47 AM
Squid: Everything working but HTTPS EricTRA Linux - Server 10 07-29-2009 02:50 AM
Horde-3.1.3 not working under https Godlikearg Linux - Software 0 12-13-2007 05:22 PM
http-->https not working realos Linux - Networking 3 07-03-2006 08:15 AM
HTTP not working, HTTPS and FTP ok smith_martin Linux - Software 6 04-29-2005 07:15 AM


All times are GMT -5. The time now is 10:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration