Apache virtualhost dinternal domain


 
Thread Tools Search this Thread
Top Forums Web Development Apache virtualhost dinternal domain
# 1  
Old 11-05-2010
Apache virtualhost dinternal domain

Hello,

I have have installed two web applications on one server with one IP address and one domain name (mynet.intra). Is it possible to configure in apache 2.2 that access to one application would be from "app1.mynet.intra" and to another application from address "app2.mynet.intra"? Document roots are on different locations, one application is in /opt/app2/public and another one is /var/apache2/2.2/htdocs/.

I was trying to create virtual hosts, but when I try to access second application (app2.mynet.intra) server always loads the first one.

Quote:

#NameVirtualHost *:80

<VirtualHost *:80>
Servername app1.mynet.intra
DocumentRoot /var/apache2/2.2/htdocs
</VirtualHost>

<VirtualHost *:80>
ServerName app2.mynet.intra
DocumentRoot /opt/app2/public
ErrorLog /opt/app2/app2_error.log


<Directory /opt/app2/public>
Options Indexes ExecCGI FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# 2  
Old 11-12-2010
As you are using the same ip address for both sites and intend to do name based hosting you have to uncomment the "NameVirtualHost".

Mike
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SVN for actual VirtualHost

hi, Earlier I had this thread posted on "UNIX for Experts" Group here in unix.com, but somehow no one bothered to respond, so I thought someone might be able to help me here. In short, I have to make accessible a directory via SVN to all 5 developers, call it /var/www/html/beta3 ... (0 Replies)
Discussion started by: busyboy
0 Replies

2. Red Hat

Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-la

Have no idea on what the below error message is: Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-launcher.jar org.apache.tools.ant.launch.Launcher -buildfile build.xml dist. Any help? (3 Replies)
Discussion started by: gull05
3 Replies

3. Web Development

Apache module development on apache 2.2

Hi, I'm new to developing modules for Apache. I understand the basics now and can develop something simple which allows a 'GET' request to happen, but what I want to do is actually 'POST' information to my site. I know the basic POST Request works and I can see that it is post by looking at... (2 Replies)
Discussion started by: fishman2001
2 Replies

4. Linux

Apache/2.2.25 VirtualHost not working

I am having problems in implementing the virtual hosts here in my server. I have this one cloud dev server: Amazon Linux AMI release 2013.03 (based on RHEL like CentOS) with Apache 2.2.25 installed and I'm trying to create 2 virtual hosts: test-kalc.tk and test2-kalc.tk. If I go to... (2 Replies)
Discussion started by: jpdoria
2 Replies

5. Red Hat

apache httpd virtual hosts setup keep hitting the same VirtualHost

I'm trying to set up two virtual hosts. Here's my httpd config: <Directory /Users/userX/dev/sandbox-2> Order deny,allow deny from All Allow from localhost </Directory> NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot "/Users/userX/dev/sandbox-2" ... (0 Replies)
Discussion started by: GlideK
0 Replies

6. Shell Programming and Scripting

virtualhost script

can anyone help me to write a script to delete the virtualhost entry in apache vhosts.conf file: hint: when i enter ./deletedomain test.com it should delete the test.com virtualhost entry from vhosts.conf file (2 Replies)
Discussion started by: pssooraj72
2 Replies

7. Web Development

Apache: Forward Proxy Via Virtualhost

I've set up a forward proxy within a VirtualHost (see below) on Apache 2.2.11. I then browse using mydomain.com:80 as the proxy - I've also tried using the IP address of the VirtualHost xxx.xxx.xxx.xxx:80. It works fine, the only problem is that in both cases the server's main IP address is always... (2 Replies)
Discussion started by: krunksta
2 Replies

8. Windows & DOS: Issues & Discussions

How to: Linux BOX in Windows Domain (w/out joining the domain)

Dear Expert, i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant. ... (2 Replies)
Discussion started by: regmaster
2 Replies

9. UNIX for Dummies Questions & Answers

Apache not logging virtual domain

A client has asked us to set up a different domain (as an alias for their site) which they could use on certain marketing material and hence measure the campaign's effectiveness. We've set it up and it all seems to be working fine except that the access log file for the new domain is stuck at zero... (2 Replies)
Discussion started by: fire>ant>
2 Replies

10. UNIX for Dummies Questions & Answers

Apache httpd.conf <VirtualHost> issue

I have just configured httpd.conf on a new Redhat 9 install. Below are my additions to httpd.conf. Everything works fine except that when typing http://spetnik.d2g.com into my web browser, I am sent to the "Default catch all" site. Any clues? NameVirtualHost *:80 #Default catch all ... (5 Replies)
Discussion started by: Spetnik
5 Replies
Login or Register to Ask a Question