SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Porto,Portugal
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Virtual hosts and phpmyadmin

    Hi.
    I am trying to configure some virtual hosts in my localhost apache server and they seem to work.
    The problem is that i canīt access to phpmyadmin. It gives an 403 forbiden error.
    I am using wamp.

    Here is my httpd-vhosts.conf:

    Code:
    #
    # Use name-based virtual hosting.
    #
    NameVirtualHost *:80
    
    <VirtualHost 127.0.0.1>
       DocumentRoot C:\wamp\www
       ServerName localhost
       ServerAlias localhost
    </VirtualHost>
    
    <VirtualHost *:80>
       DocumentRoot H:\Websites\Testing\wordpress
       ServerName wordpress
       ServerAlias wordpress
    </VirtualHost>
    
    <Directory H:\Websites\Testing\wordpress>
      Order Deny,Allow
      Allow from all
    </Directory>
    Any help?

  2. #2
    SitePoint Enthusiast nofun's Avatar
    Join Date
    Apr 2009
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you modified you windows hosts file also? I see you only want to access them locally.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Porto,Portugal
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have add 127.0.0.1 wordpress line into hosts file.

    I have managed to fix the 403 error by change the permissions of wamp directory in httpd.conf.Now i am geting 404 error.

    If i put localhost in browser it shows the wamp index page and if i wrote wordpress it goes to the correct directory so the virtual hosts are working.

    Note that the wamp server path is c:\wamp, the apache path is c:\wamp\bin\apache and phpmyadmin is c:\wamp\apps\phpmyadmin.

    without virtual hosts, phpmyadmin url is localhost/phpmyadmin.

    Maybe i need to change something in phpmyadmin.conf.

    Code:
    Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.1.1/" 
    
    # to give access to phpmyadmin from outside 
    # replace the lines
    #
    #        Order Deny,Allow
    #	Deny from all
    #	Allow from 127.0.0.1
    #
    # by
    #
    #        Order Allow,Deny 
    #   Allow from all
    #
    
    <Directory "c:/wamp/apps/phpmyadmin3.1.1/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
            Order Deny,Allow
    	Deny from all
    	Allow from 127.0.0.1
    </Directory>

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Porto,Portugal
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No one?

  5. #5
    SitePoint Enthusiast nofun's Avatar
    Join Date
    Apr 2009
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry but I'm out of ideas. Maybe try to make the path relative to the www directory. something like

    Alias /phpmyadmin "../apps/phpmyadmin3.1.1/"

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    popo,

    You have not created a VH for phpmyadmin so I'm not sure what you're asking for. You've done it correctly (httpd-vhosts.conf and hosts) so just do the same for PMA (phpmyadmin) using its physical address (using /'s, not \'s).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Porto,Portugal
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. I have created a virutal host for phpmyadmin.

    Results:
    -I can acess to phpmyadmin but when i try to create a db in gives a 404 error.
    -The alias localhost/phpmyadmin still doesnīt work.

    Code:
    <VirtualHost *:80>
       DocumentRoot "C:/wamp/apps/phpmyadmin3.1.3.1"
       ServerName phpmyamdin
       ServerAlias phpmyamdin
        <Directory "C:/wamp/apps/phpmyadmin3.1.3.1">
    		AllowOverride All
    		Order allow,deny
    		Allow from all
      </Directory>
    </VirtualHost>
    Code:
    127.0.0.1 phpmyadmin

  8. #8
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    popo,

    404 is an missing page which indicates to me that the configuration isn't setup for its own domain and the URIs are absolute (relative to localhost).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  9. #9
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Porto,Portugal
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am so stupid.
    The phpmyadmin url was wrong. It was "C:/wamp/apps/phpmyadmin3.1.1" instead of "C:/wamp/apps/phpmyadmin3.1.3.1"

    Now everything seems to be working.

  10. #10
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    popo,

    Don't pet the sweaty stuff! $#!t happens! Thanks, though, for letting us know it's resolved.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •