Re: is this possible in PHP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I want a script that can display a list of all the websites currently
> hosted on my server.. (i have root access to the server)
>
> Say I have a page sitesonmyserver.php..it shud show a list of all the
> websites hosted on my server..eg:
> abc.com
> xyz.om
>
> And any additional info if possible?

I'd make a script that went through the httpd.conf file with DOM and
pulled out all the virtual hosts.  Either that or looked at the home
directory listings for each site.  If this is what you were getting at
(seeing as you mentioned root access and what-not), then read the next
paragraph.  If not, you can skip the next paragraph.

This is quite a dangerous thing to do.  Giving PHP root access to your
server is like giving a homeless guy your credit card.  Anyone can
access the resources that PHP uses if they try hard enough.  You might
as well just hand every hacker on the web a little Post-It note with
your root password on it.

> Is such a thing possible in PHP.. or does any such script exists?

Definitely.  If you take the right approach!  I'd use a database.  You
could certainly find a class or script that could accomplish the
database lookup that would get what you wanted.

I'd start by reading the manual sections on mySQL database queries.

http://us4.php.net/mysql

Hope this helps!

--
The Disguised Jedi
disguised.jedi@xxxxxxxxx

Now you have my $0.02.  Or .01 Pounds, .014 Euros, or $0.025 CAN.  I'm
world-wide BABY!
PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux