Solved

Where am I going to put these codes in Apache/2.2.9 (Debian)

Posted on 2009-05-20
3
274 Views
Last Modified: 2013-12-06
Need urgent help as I'm still at work and it's already 9:00pm.
we transfer our site to a new webserver with the new debian apache2 package.
now, with the debian apache2 package, everything is modularized and took me time to know where to set the virtualhosts. now with the htaccess or security settings as posted below.

thanks
#MYWEBSITE1

<Directory "/var/www/mywebsite1">

AllowOverride All

Options +FollowSymLinks Indexes

Order deny,allow

</Directory>
 

#MYWEBSITE2

<Directory "/var/www/mywebsite2">

AllowOverride All

Options +FollowSymLinks Indexes

Order deny,allow

</Directory>

Open in new window

0
Comment
Question by:Raleigh
  • 3
3 Comments
 
LVL 8

Accepted Solution

by:
yfastud earned 500 total points
ID: 24431593
you should put them in httpd-vhosts.conf if already enable this file in main config file httpd.conf as below; also make sure to create folder logs in each appropriate folder to make it work

NameVirtualHost *:80
 

#MYWEBSITE1

<VirtualHost *:80>

ServerName www.mywebsite1.com

ServerAlias mywebsite1.com mywebsite1

DocumentRoot /var/www/mywebsite1

ErrorLog /var/www/mywebsite1/logs/error.log

CustomLog /var/www/mywebsite1/logs/access.log common

<Directory "/var/www/mywebsite1">

AllowOverride All

Options +FollowSymLinks Indexes

Order deny,allow

</Directory>

</VirtualHost>
 

#MYWEBSITE2

<VirtualHost *:80>

ServerName www.mywebsite2.com

ServerAlias mywebsite2.com mywebsite2

DocumentRoot /var/www/mywebsite2

ErrorLog /var/www/mywebsite2/logs/error.log

CustomLog /var/www/mywebsite2/logs/access.log common

<Directory "/var/www/mywebsite2">

AllowOverride All

Options +FollowSymLinks Indexes

Order deny,allow

</Directory>

</VirtualHost>

Open in new window

0
 
LVL 8

Assisted Solution

by:yfastud
yfastud earned 500 total points
ID: 24431786
btw, I've copied and pasted, and after posted, I've recognized you had little mistake in your script which should includes some permission after "Order deny,allow"; for example

Order deny,allow

deny from all

allow from xxx.xxx.xxx.xxx

Open in new window

0
 
LVL 8

Assisted Solution

by:yfastud
yfastud earned 500 total points
ID: 24431982
btw, httpd.conf file should be in apache2 dir and httpd-vhosts.conf file should be in apache2/extra dir
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now