Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jan 09, 2015 10:30 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
Cromulent wrote:
douglerner wrote:
As a final note here, it does seem Linode support was correct. I was able to create the PHP scripts to connect with the LinkedIn API and am successfully connecting and getting full profiles back after a user grants authorization.

So there are no current problems.

Again, thanks for the help people.

doug


Your Apache configuration is still wrong. You need to stop serving HTTP traffic on port 443 (which is meant for SSL only).

Plus I can access your access.log and error.log from the website which you really really want to stop.

So you need to fix your Apache config as well (as many other people have said in this thread).


How are you viewing the access.log and error.log so I can confirm I can block it?

Thanks,

doug


Top
   
PostPosted: Fri Jan 09, 2015 10:36 am 
Offline
Senior Newbie

Joined: Fri Mar 08, 2013 5:47 am
Posts: 15
douglerner wrote:
Cromulent wrote:
douglerner wrote:
As a final note here, it does seem Linode support was correct. I was able to create the PHP scripts to connect with the LinkedIn API and am successfully connecting and getting full profiles back after a user grants authorization.

So there are no current problems.

Again, thanks for the help people.

doug


Your Apache configuration is still wrong. You need to stop serving HTTP traffic on port 443 (which is meant for SSL only).

Plus I can access your access.log and error.log from the website which you really really want to stop.

So you need to fix your Apache config as well (as many other people have said in this thread).


How are you viewing the access.log and error.log so I can confirm I can block it?

Thanks,

doug



http://eldisodi.webcrossing.com:443/eld ... access.log
http://eldisodi.webcrossing.com:443/eld ... g.com/log/
http://eldisodi.webcrossing.com:443/eld ... ssing.com/
http://eldisodi.webcrossing.com:443/


Top
   
PostPosted: Fri Jan 09, 2015 10:43 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
Thanks. I'll check about blocking those.

doug


Top
   
PostPosted: Fri Jan 09, 2015 10:45 am 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:35 pm
Posts: 111
Location: United Kingdom
douglerner wrote:
I don't know what to say about the HTTP traffic on port 443 issue. Linode support disagrees.


I hate to contradict people who know more about Linux than myself but if they said it was fine and OK to serve HTTP (and not HTTPS) on port 443 they were wrong.


Top
   
PostPosted: Fri Jan 09, 2015 10:51 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
Cromulent wrote:
douglerner wrote:
I don't know what to say about the HTTP traffic on port 443 issue. Linode support disagrees.


I hate to contradict people who know more about Linux than myself but if they said it was fine and OK to serve HTTP (and not HTTPS) on port 443 they were wrong.


Perhaps so. I'm discussing it with them again.

Thanks,

doug


Top
   
PostPosted: Fri Jan 09, 2015 11:34 am 
Offline
Junior Member

Joined: Wed Mar 28, 2012 4:29 pm
Posts: 38
douglerner wrote:
Cromulent wrote:
douglerner wrote:
I don't know what to say about the HTTP traffic on port 443 issue. Linode support disagrees.


I hate to contradict people who know more about Linux than myself but if they said it was fine and OK to serve HTTP (and not HTTPS) on port 443 they were wrong.


Perhaps so. I'm discussing it with them again.

Thanks,

doug


To be more precise: You can serve HTTP on any port if you want, but in 99.999% of cases you'll want to be serving HTTPS on port 443 because that's what the rest of the world expects.

Kinda like how your car will physically be able to drive the wrong way on the highway, but people might be surprised if they come across you.


Top
   
PostPosted: Fri Jan 09, 2015 11:47 pm 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
Well, for some reason all the things Support asked me to try didn't work, and the directories were still exposed via port 443. We closed all the Listening to 443 in all the Apache configuration files, but it didn't seem to make a difference.

But I just tried this myself and it seems to have worked, and is not adversely affecting my PHP API to LinkedIn:

1. I edited /etc/iptables.firewall.rules

2. I commented out the line

-A INPUT -p tcp --dport 443 -j ACCEPT

3. I ran the following command:

iptables-restore < /etc/iptables.firewall.rules

That seems to have worked. I believe you cannot get to the log files or see the index via 443 now. Anybody feel like confirming?

I think instead of commenting out the ACCEPT line I could have just changed ACCEPT to DROP. Would that have been preferable?

Thanks,

doug


Top
   
PostPosted: Fri Jan 09, 2015 11:51 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Code:
apache2ctl -S


- Les


Top
   
PostPosted: Sat Jan 10, 2015 12:11 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
akerl wrote:
Code:
apache2ctl -S


- Les


Sorry. Can you tell me what you are asking me to do? Are you saying to use that command instead of what I did with the IP tables? Or in addition to what I've already done?

Thanks,

doug


Top
   
PostPosted: Sat Jan 10, 2015 12:41 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
I asked for the output of that command at the beginning of this adventure, and I'm asking for it again now.

Blocking port 443 at iptables is a bandaid over the real problem, and if there's ever an issue that prevents the firewall rules from loading in the future or negates that rule, your misconfigured virtualhost will be exposed again.

- Les


Top
   
PostPosted: Sat Jan 10, 2015 12:44 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
akerl wrote:
I asked for the output of that command at the beginning of this adventure, and I'm asking for it again now.

Blocking port 443 at iptables is a bandaid over the real problem, and if there's ever an issue that prevents the firewall rules from loading in the future or negates that rule, your misconfigured virtualhost will be exposed again.

- Les


I see. Sorry, I did not notice your previous request. Here is the output of that command:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 176.58.126.189. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 eldisodi.webcrossing.com (/etc/apache2/sites-enabled/eldisodi.webcrossing.com.conf:4)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33


Top
   
PostPosted: Sat Jan 10, 2015 12:50 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
And you've restarted Apache since changing your configs? What's in /etc/apache2/sites-enabled/eldisodi.webcrossing.com.conf ? Also /etc/apache2/ports.conf?


Top
   
PostPosted: Sat Jan 10, 2015 1:10 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
Yes, after changing config files I always run

service apache2 start

Here are the other contents.

/etc/apache2/sites-enabled/eldisodi.webcrossing.com.conf

# domain: example.com
# public: /var/www/example.com/public_html/

<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin doug@elliptics.com
ServerName eldisodi.webcrossing.com
ServerAlias eldisodi.webcrossing.com

# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/eldisodi.webcrossing.com/public_html
# Log file locations
LogLevel warn
ErrorLog /var/www/eldisodi.webcrossing.com/log/error.log
CustomLog /var/www/eldisodi.webcrossing.com/log/access.log combined
Options -Indexes
</VirtualHost>

/etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
# Listen 443
</IfModule>

<IfModule mod_gnutls.c>
# Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


Top
   
PostPosted: Sat Jan 10, 2015 1:21 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
You realize, of course, that "service apache2 start" starts apache2, it doesn't restart it?

You want "service apache2 restart".

- Les


Top
   
PostPosted: Sat Jan 10, 2015 1:52 am 
Offline
Junior Member

Joined: Sat Nov 06, 2010 4:36 am
Posts: 45
akerl wrote:
You realize, of course, that "service apache2 start" starts apache2, it doesn't restart it?

You want "service apache2 restart".

- Les


Actually, I did not realize that. Let me try and undo the IP table thing and try the restart.

(pause to try)

I just did the following:

1. I edited vi /etc/iptables.firewall.rules and restored it to its original configuration, where there is a line

-A INPUT -p tcp --dport 443 -j ACCEPT

in it and ran

iptables-restore < /etc/iptables.firewall.rules

Immediately after doing that I could see the directory with a 443 connection again.

2. I ran

service apache2 restart

Immediately after that I got a failure to connect with a 443 connection.

And my PHP API is still working on port 80.

Thank you very much. I'm very grateful. I'm sorry for any confusion I caused by my inexperience with this.

I guess this seems ok now, right?

Regards,

doug


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group