Re: Lighttpd and phpmyadmin 404 not found

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Lisa Kachold
Date:  
To: Main PLUG discussion list
Subject: Re: Lighttpd and phpmyadmin 404 not found
Hi there, how are you?

You just need to fix your rewrite line:

#### url handling modules (rewrite, redirect, access)
# url.rewrite                 = ( "^/$"             => "/server-status"
)
# url.redirect                = ( "^/wishlist/(.+)" =>
"http://www.localhost.localdomain/$1" )


You can also hack how your site displays via an entry in your /etc/hosts
file and a hostname that resolve as 127.0.0.1 or whatever your DHCP address
is.

So you just add an entry:

127.0.0.1       localhost localhost.localdomain
127.0.0.1       hack.me.microsoft.com


That matches whatever your "real site" will be.

192.168.1.6     hack.me.microsoft.com localhost.localdomain


When you restart your server, your web daemon will match this to your
rewrite line.

There's a whole lot you can do with your /etc/hosts file to exclude 3rd
party cookies, develop in the "real IP address" for those of you with DNS or
hardcoded URL limitations.


See my full inline response below.

On Fri, Apr 22, 2011 at 10:46 AM, <> wrote:

> Hi,
>
> Does anyone know Lighttpd server?
>
> Every time I try to access localhost/phpmyadmin or
> localhost/phpmyadmin/index.php I get a 404 - Not Found. But,
> http://localhost/testphp.php works OK. I had Apache installed in the
> past but removed it and recently installed Lighttpd. I'm using Lubuntu
> 10.10 a flavor of Ubuntu and using my laptop (localhost)as a testbed to
> learn. I have tried restarting Lighttpd after each change to the conf
> file. Please tell me if more info is needed to help fix it and I will
> post it. Here is my lighttpd.conf. Thanks for the help:
>
> # Debian lighttpd configuration file
> #
>
> ############ Options you really have to take care of
> ####################
>
> ## modules to load
> server.modules = (
>            "mod_alias",
>            "mod_compress",
> #           "mod_rewrite",
> #           "mod_redirect",
> #           "mod_usertrack",
> #           "mod_expire",
>            "mod_flv_streaming",
> #           "mod_evasive"
>            "mod_fastcgi"
> )

>
> ## a static document-root, for virtual-hosting take look at the
> ## server.virtual-* options
> server.document-root       = "/var/www/"

>
> ## where to upload files to, purged daily.
> server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
>
> ## where to send error-messages to
> server.errorlog            = "/var/log/lighttpd/error.log"

>
> ## files to check for if .../ is requested
> index-file.names           = ( "index.php", "index.html",
>                               "index.htm", "default.htm",
>                               "index.lighttpd.html" )

>
> ## Use the "Content-Type" extended attribute to obtain mime type if
> possible
> # mimetype.use-xattr = "enable"
>
> ##
> # which extensions should not be handle via static-file transfer
> #
> # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
> static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
>
> ######### Options that are good to be but not neccesary to be changed
> #######
>
> ## Use ipv6 only if available. (disabled for while, check #560837)
> #include_shell "/usr/share/lighttpd/use-ipv6.pl"
>
> ## bind to port (default: 80)
> # server.port               = 81

>
> ## bind to localhost only (default: all interfaces)
> ## server.bind                = "localhost"

>
> ## error-handler for status 404
> #server.error-handler-404 = "/error-handler.html"
> #server.error-handler-404 = "/error-handler.php"
>
> ## to help the rc.scripts
> server.pid-file            = "/var/run/lighttpd.pid"

>
> ##
> ## Format: <errorfile-prefix><status>.html
> ## -> ..../status-404.html for 'File not found'
> #server.errorfile-prefix    = "/var/www/"

>
> ## virtual directory listings
> dir-listing.encoding        = "utf-8"
> server.dir-listing          = "enable"

>
> ### only root can use these options
> #
> # chroot() to directory (default: no chroot() )
> #server.chroot            = "/"

>
> If you are in an open network, or running in a DMZ, you certainly want to

use chroot for your server.
Just set this to the directory above your DocumentRoot.


> ## change uid to <uid> (default: don't change)
> server.username            = "www-data"

>
> ## change gid to <gid> (default: don't change)
> server.groupname           = "www-data"

>
> #### compress module
> compress.cache-dir          = "/var/cache/lighttpd/compress/"
> compress.filetype           = ("text/plain", "text/html",
> "application/x-javascript", "text/css")

>
> #### url handling modules (rewrite, redirect, access)
> # url.rewrite                 = ( "^/$"             => "/server-status"
> )
> # url.redirect                = ( "^/wishlist/(.+)" =>
> "http://www.123.org/$1" )

>


This is your breakage, set it to something that matches the hostname, exists
in /etc/hosts and resolves from whereever you are browsing from.

>
> #### expire module
> # expire.url                  = ( "/buggy/" => "access 2 hours",
> "/asdhas/" => "access plus 1 seconds 2 minutes")

>
> #### external configuration files
> ## mimetype mapping
> include_shell "/usr/share/lighttpd/create-mime.assign.pl"
>
> ## load enabled configuration files,
> ## read /etc/lighttpd/conf-available/README first
> include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
>
> ## added later by goldtech
>
> fastcgi.server = ( ".php" => ((
>                     "bin-path" => "/usr/bin/php-cgi",
>                     "socket" => "/tmp/php.socket"
>                 )))

>
> flv-streaming.extensions = ( ".flv" )
>
> alias.url = ( "/phpmyadmin/” => “/usr/share/phpmyadmin/")
>
> ------end of file
>
>

And when your code is ready, run Rapid 7 Community edition web scanner
against her and mitigate or obfuscate the risks.
--
(503) 754-4452 iPhone
(623) 239-3392 Skype
(623) 688-3392 Google Voice

http://www.it-clowns.com

"It took me many years but I have gained access to the root account and have
removed the user God." -Saros
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss