top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Website access without initial www

+1 vote
486 views

I am using Apache2.2.22 on a Debian7 server. Hosting multiple websites, but have reduced it to just one for now to try to figure out this problem.

So, if I go to: www.mysite.com the website shows up. HOWEVER, if I go to just: mysite.com from outside our company network, I get the error "Forbidden. You don't have permission to access / on this server."

From inside the company network, however, it works fine. Here is the only file in /etc/apache2/sites-enabled

NameVirtualHost *:80
 ServerAdmin abc@abc.com

 DocumentRoot /var/www/mysite
 ServerName www.mysite.com
 ServerAlias mysite.com

 Options FollowSymLinks
 AllowOverride None

 Options FollowSymLinks
 AllowOverride None
 Order allow,deny
 allow from all
 # This directive allows us to have apache2's default start  page
 # in /apache2-default/, but still have / go to the right place
 #RedirectMatch ^/$ /apache2-default/

 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

 AllowOverride None
 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
 Order allow,deny
 Allow from all

 ErrorLog /var/log/apache2/error.log

 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn

 CustomLog /var/log/apache2/access.log combined
 ServerSignature On

 Alias /doc/ "/usr/share/doc/"

 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order deny,allow
 Deny from all
 Allow from 127.0.0.0/255.0.0.0 ::1/128
posted Sep 11, 2013 by Sheetal Chauhan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Do requests to the non-www site show up in the access or error log? (run tail -n 0 -f /var/log/apache2/*.log and access the bare domain.)
There might be something useful there if you compare it with a good request. Additionally, I recommend changing your CustomLog to combined_vh (I think that is what it is) so that the virtualhostname is in the log too.

answer Sep 11, 2013 by Ahmed Patel
Looks like a different server is answering the www one and the non www one.
Similar Questions
+3 votes

which software (html/css/js..etc etc) is required to create website like www.livebooks.com or Photoshelter.com (DIY: do it yourself).
for Frontend and backend both??

+2 votes

I am working on an app with Java and Struts2.
I fetch all data from my DB to an Object(eg.XXX) List at once while Tomcat(7) is coming up. Then according to user selection, I am trying to get data from the same List by doing Ajax call. But it is failing and getting an empty list. I don't want to use session.
Can I use and global object list for this?? An Example will be more helpful.

+1 vote

The Barracuda load balancer has feature which enables it to recover a broken web connection. Let me explain the scenario; suppose that there exist two web servers behind the Barracuda load balancer and the user is downloading a file from one of the back-end web servers. Now, suppose that the active web server goes down, the Barracuda load balancer is capable of continuing the download from where it was broken using the other web server. Is it possible to achieve such a behaviour using mod_proxy_balancer? Are there exist any open source alternatives which can provide the same capability? If not, is anybody aware of any roadmap to achieve the same functionality using open source tools? Considering mod_proxy_balancer, what are the required steps to follow in order to add such a functionality?

...