SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    Non-Member
    Join Date
    Jul 2005
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cant get rails + normal apache working simulataneously

    The problem for me is that I can get either XAMPP or the blog working, but not both together. As soon as I add the Virtual Hosts and host file lines, XAMPP fails.

    I even tried two virtual hosts and entries in host file. Here is the section from httpd.conf.


    ServerName blog
    DocumentRoot c:/rails/blog/public/
    ErrorLog c:/rails/blog/log/apache.log


    Options ExecCGI FollowSymLinks
    AllowOverride all
    Allow from all
    Order allow,deny


    ServerName xampp
    DocumentRoot c:/xampp/htdocs/
    ErrorLog c:/xampp/apache/logs/error.log


    Options ExecCGI FollowSymLinks
    AllowOverride all
    Allow from all
    Order allow,deny

    When I try to load xampp in browser, I get the Rails welcome page.
    I took this from loudthinking.com because it explains exactly the problem Im having, I realise this a problem with the way the virtual hosts are being set up but I'd really like to be able to run both at the same time rather than rebooting apache every time i want to run the rails app and then a normal app inside htdocs

  2. #2
    Non-Member
    Join Date
    Jul 2005
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I found this somewhere which is supposed to work:

    Code:
    <VirtualHost 127.0.0.1>
    		ServerAdmin admin@localhost
    		DocumentRoot "C:/PROGRA~1/APACHE~1/Apache2/htdocs"
    		ServerName localhost
    		ErrorLog logs/localhost_error.log
    		CustomLog logs/localhost_access.log common
    	</VirtualHost>
    
    <VirtualHost 127.0.0.1>
    	DocumentRoot "c:/dev/test/public"
    	ServerName test
    	ServerAlias *.test
    	ErrorLog c:/dev/test/log/server.log
    		<Directory "c:/dev/tfm/public">
    			  Options ExecCGI FollowSymLinks
    			  AllowOverride all
    			  Allow from all
    			  Order allow,deny
    		</Directory>
    </VirtualHost>
    But I get some kind of virtualhost overlapping error when restarting apache - it closes too fast for me to see it though and it seems to be just using the first virtualhost and not the second?

  3. #3
    Non-Member
    Join Date
    Jul 2005
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Solved it:

    To anyone else having the same problem, use the config above but before it put:

    NameVirtualHost 127.0.0.1:80

    That will resolve the issue for people wanting to run multiple rails apps on a local test server or regular apache and multiple rails apps together etc.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •