Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Aug 28, 2015 10:33 am 
Offline
Senior Newbie

Joined: Mon Jul 06, 2015 7:30 am
Posts: 6
hey, I want to use my linode without a domain name. I host some PHP scripts that I want to execute. Currently my content is in var/www/html/olddomain.com. How do I set it up so I can access like this : e.g. http://xxx.xxx.xx.xx/index.php ? Do I need to edit the local hosts file? Where would I move my content to?

Any pointers on this would be really appreciated. thanks!


Top
   
PostPosted: Sat Aug 29, 2015 3:38 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
With Apache, the first configured site will handle any requests that don't ask for an explicit host. This includes requests going to a URL using an IP address.

You should be able to just enable the default site and then put the files you want to serve in the directory specified as its DocumentRoot (often this is /var/www/html, but it depends on the distribution). So if you put index.php in the DocumentRoot, people would be able to access it at http://12.34.56.78/index.php where they'd substitute your actual IP address.


Top
   
PostPosted: Sun Aug 30, 2015 1:16 pm 
Offline
Senior Newbie

Joined: Mon Jul 06, 2015 7:30 am
Posts: 6
Vance wrote:
With Apache, the first configured site will handle any requests that don't ask for an explicit host. This includes requests going to a URL using an IP address.

You should be able to just enable the default site and then put the files you want to serve in the directory specified as its DocumentRoot (often this is /var/www/html, but it depends on the distribution). So if you put index.php in the DocumentRoot, people would be able to access it at http://12.34.56.78/index.php where they'd substitute your actual IP address.


Thanks for this. How would I enable the default site?


Top
   
PostPosted: Mon Aug 31, 2015 12:49 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
You would run a2ensite name-of-site where name-of-site is the name of the site configuration file in sites-available. If you tell us what operating system and version you are using, we can provide more specific guidance.


Top
   
PostPosted: Tue Sep 01, 2015 5:29 am 
Offline
Senior Newbie

Joined: Mon Jul 06, 2015 7:30 am
Posts: 6
Vance wrote:
You would run a2ensite name-of-site where name-of-site is the name of the site configuration file in sites-available. If you tell us what operating system and version you are using, we can provide more specific guidance.



Ah I got it! Got it working. Thanks a lot for your help :D


Top
   
PostPosted: Sun Sep 06, 2015 10:13 pm 
Offline
Newbie

Joined: Sun Sep 06, 2015 9:42 pm
Posts: 2
another way, you can add your domain and your IP to your client. (in windows C:\Windows\System32\drivers\etc\hosts)
or in linux /etc/hosts

_________________
APKTrunk - Android APK Collection


Top
   
PostPosted: Tue Sep 08, 2015 9:56 am 
Offline
Linode Staff

Joined: Mon Sep 29, 2014 4:47 pm
Posts: 90
Twitter: FelicianoTech
Just keep in mind that the last method mentioned would only work for you locally on that specific computer.


Top
   
PostPosted: Mon Nov 23, 2015 12:09 pm 
Offline

Joined: Sat Nov 21, 2015 3:25 pm
Posts: 1
kekearif wrote:
Vance wrote:
With Apache, the first configured site will handle any requests that don't ask for an explicit host. This includes requests going to a URL using an IP address.

You should be able to just enable the default site and then put the files you want to serve in the directory specified as its DocumentRoot (often this is /var/www/html, but it depends on the distribution). So if you put index.php in the DocumentRoot, people would be able to access it at http://12.34.56.78/index.php where they'd substitute your actual IP address.


Thanks for this. How would I enable the default site?


Park you domain and then bind your apache to your server's ip address. don't forget to open the port 80 if you are listening on that port.
restart apache server and you should now see your default site.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group