LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   invoke php from a self made webpage on my home computer (https://www.linuxquestions.org/questions/linux-software-2/invoke-php-from-a-self-made-webpage-on-my-home-computer-4175416666/)

Wim Sturkenboom 07-15-2012 10:31 PM

From http://httpd.apache.org/docs/2.0/vhosts/name-based.html :

Code:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>

I'm not sure how Ubuntu works from this perspective; I use slackware servers. Maybe http://www.ubuntugeek.com/howto-crea...in-apache.html can be of help for you.

PS Don't forget to restart apache after changes in its configuration.

Wim Sturkenboom 07-15-2012 10:42 PM

How do you access your new site? http://pedro or http://localhost/pedro?

You might have to setup an entry in /etc/hosts that links pedro to 127.0.0.1 like below. The first line already exists, the second one (in italic red) should be added.
Code:

        127.0.0.1      localhost
        127.0.0.1      pedro

This allows the domain name pedro to be resolved to 127.0.0.1 by the webbrowser (else it will look somewhere on the web). Next you should be able to access it with http://pedro in the browser.

Pedroski 07-15-2012 10:47 PM

Hey! Brilliant!!

I already had this in hosts:

127.0.0.1 localhost
127.0.1.1 pedro-bedro

and apache said it was on 127.0.1.1 so I entered pedro-bedro, and bam!

Thanks for that! Now to see if the php script works!

Wim Sturkenboom 07-16-2012 02:16 AM

Great. Please mark your thread as solved using the thread tools just above the first post on this page.


All times are GMT -5. The time now is 11:26 AM.