Results 1 to 3 of 3

Thread: phpMyAdmin

  1. #1
    Join Date
    Apr 2009
    Posts
    11

    Default phpMyAdmin

    Hello,

    I am currently setting up a Fedora 11 server and have most things installed and ready to go, but I am stuck on getting phpmyadmin to work.

    I have done it before so the config is not a problem for me. I'll try to explain the best I can.

    In httpd.conf the default Document root is set to "/var/www/html" but I have VirtualHost's set up.

    Code:
    <VirtualHost *:80>
        ServerAdmin myemail
        DocumentRoot /home/username/www/html/mainwebsite
        ServerName website #1
        ServerAlias website#1.com www.website#1.com
        ScriptAlias /cgi-bin/ /home/username/www/html/mainwebsite/cgi-bin/
        ErrorLog logs/error_log
        CustomLog logs/access_log common
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin myemail
        DocumentRoot /home/username/www/html/subdomain#1
        ServerName subdomain#1
        ServerAlias subdomain#1.website#1.com www.subdomain#1.website#1.com
        ScriptAlias /cgi-bin/ /home/username/www/html/subdomain#1/cgi-bin/
        ErrorLog logs/error_log
        CustomLog logs/access_log common
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin myemail
        DocumentRoot /home/username/www/html/subdomain#2
        ServerName subdomain#2
        ServerAlias subdomain#2.website#1.com www.subdomain#2.website#1.com
        ScriptAlias /cgi-bin/ /home/username/www/html/subdomain#2/cgi-bin/
        ErrorLog logs/error_log
        CustomLog logs/access_log common
    </VirtualHost>
    
    <VirtualHost SecondIPaddress:80>
        ServerAdmin myemail
        DocumentRoot /home/username/www/html/mainwebsite
        ServerName website #2
        ServerAlias website#2.com www.website#2.com
        ScriptAlias /cgi-bin/ /home/username/www/html/website#2/cgi-bin/
        ErrorLog logs/error_log
        CustomLog logs/access_log common
    </VirtualHost>
    So when I put the phpmyadmin folder in /home/user/www/html I would get either a 404 or could not access the server.

    I tried changing the virtualHosts to /home/username/www/html/ and it worked then, but then the actual sites didn't work correctly either. I also tried to just put it in /var/www/html, the root diretory and nothing.

    If anyone has any idea's or solutions, I would appreciate it.

    Thanks in advance.

  2. #2
    Join Date
    Jul 2007
    Location
    127.0.0.1
    Posts
    392

    Default

    Not sure how this works for Apache, but with Lighttpd, I had to setup an "alias" for the virt-domains.. For example:

    Code:
    $SERVER["socket"] == "67.223.255.255:9925" {
    
    	ssl.engine = "enable"
    	ssl.pemfile = "/etc/lighttpd/ssl/virt-host.tld/server.pem"
    
    	$HTTP["host"] =~ "virt-host.tld" {
    
    		$HTTP["remoteip"] !~ "68.95|127.0.0" {
    			url.access-deny = ( "" ) 
    		}
    
    		var.servername = "virt-host.tld"
    		server.document-root = "/var/www/" + servername
    		accesslog.filename = "/var/log/httpd/" + servername + "-access.log"
    
    		alias.url = (
    			"/phpmyadmin" => "/usr/share/phpmyadmin",
    			"/stats/" => "/usr/lib/cgi-bin/"
    		)
    	}
    }
    Looks like you have "ScriptAlias" defined, but compared to the lighttpd config, it looks incomplete? How does Apache know where the "/phpMyAdmin" folder is on the disk?

  3. #3
    Join Date
    Mar 2009
    Posts
    137

    Default

    as guy said, in your apache2.conf file there is an alias section and you use it as follows
    Alias /phpmyadmin /pathtophpmyadminfolder
    and also the security

    <Directory /pathtophpmyadminfolder>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

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
  •