LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-17-2012, 10:14 PM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool Webhosting using apache


hi guys, need your insight on this.
if i have one static ip and my centos server is behind a cisco nat router.

Cisco nat router already configured for nat translation from public ip to private ip and vice versa.

now my question is, how do i set the apache so the site can be hosted locally and over the internet as well.

what i mean is, i can access the site locally using:
http://192.168.1.100:8000
and also:
using the internet like: http://mywebsite.com:8000

is there a way to do it? please bear with me, trying to figure out things in CENTOS.

thanks in advance for any input,
 
Old 02-18-2012, 12:35 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
Have you tried changing the default listen port on Apache from 80 to 8000 ?

Look at line 276 in /etc/httpd/conf/httpd.conf

??
 
Old 02-18-2012, 02:39 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
You can do that with virtual hosts that share the same document root.

http://httpd.apache.org/docs/2.2/en/vhosts/
 
Old 02-20-2012, 09:45 PM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by j-ray View Post
You can do that with virtual hosts that share the same document root.

http://httpd.apache.org/docs/2.2/en/vhosts/
hi j-ray, thanks for the reply.

So such scenario can only be done using virtual hosts.

Is there any other workaround on it, aside from using virtual hosts?

Thanks.
 
Old 02-21-2012, 04:27 AM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Maybe there are other opportunities but the virtual hosts are pretty straightforward for this. Copy 12 lines to your httpd.conf, edit them according to your names and restart the server. That's it.

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/domain
</VirtualHost>
 
Old 02-21-2012, 04:07 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Moderator response

Moved: This thread is more suitable in <Linux-Server> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 02-22-2012, 02:16 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by onebuck View Post
Moved: This thread is more suitable in <Linux-Server> and has been moved accordingly to help your thread/question get the exposure it deserves.
Thanks onebuck, so any ideas guys how can it be done other than virtual hosts.

I'm sure there's some other way, please share your ideas.
 
Old 02-23-2012, 07:53 AM   #8
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
hi, is there any software to support multiple hosting other than using virtual hosts in CentOS... thanks.
 
Old 02-23-2012, 10:00 AM   #9
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Learn about vhosts and use apache, that's what the rest of the world has done!
 
Old 02-24-2012, 07:57 PM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by TenTenths View Post
Learn about vhosts and use apache, that's what the rest of the world has done!
hi TenTenths, actually my friend server who's having a small business. His Linux Server is hosting three web sites, he had asked me to check what is the configuration. So he can cancel the maintenance and do it on our own.
I had checked the httpd.conf under the vhost settings but there's nothing over there.
There's not even any changes from the original httpd.conf settings, so i don't know how they did it. That's why i'm asking.
 
Old 02-24-2012, 09:52 PM   #11
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Two commands on the command line would probably tell you how.

httpd -? to get the help, then httpd -S to show the vhosts.

If you're not getting that far on your own then I wouldn't recommend running a production web server for anyone until you've a bit more experience, but that's just my opinion.
 
Old 02-25-2012, 01:40 AM   #12
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Depending on the distribution the default location to look for virtual host configs are i. E.
/etc/apache2/vhosts.d
/etc/apache2/sites-enabled
or such but probably you find some additional configs that are loaded in httpd.conf.
Quote:
I wouldn't recommend running a production web server for anyone until you've a bit more experience
I don't recommend neither
 
Old 02-26-2012, 07:49 PM   #13
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Smile

Quote:
Originally Posted by TenTenths View Post
Two commands on the command line would probably tell you how.

httpd -? to get the help, then httpd -S to show the vhosts.

If you're not getting that far on your own then I wouldn't recommend running a production web server for anyone until you've a bit more experience, but that's just my opinion.
hi TenTenths, when i type httpd -S there is no configuration for the vhosts.

[root@myserver user1]# /usr/sbin/httpd -S
httpd: apr_sockaddr_info_get() failed for myserver.server.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
VirtualHost configuration:
Syntax OK

i just wanted to know how they were able to host multiple sites without using the vhost, please don't be too harsh in your comment. I'm not trying to mess up with the server, i just wanted to check their configuration.

Thanks.
 
Old 02-26-2012, 07:51 PM   #14
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by j-ray View Post
Depending on the distribution the default location to look for virtual host configs are i. E.
/etc/apache2/vhosts.d
/etc/apache2/sites-enabled
or such but probably you find some additional configs that are loaded in httpd.conf.

I don't recommend neither
Hi j-ray, i tried to search for vhosts.d, using find / -name vhosts.d -print but nothing comes out on the result.

same goes with the sites-enabled, any ideas how they were able to hosts multiple sites on the server without those configurations?

thanks.
 
Old 02-27-2012, 01:17 AM   #15
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
thank you guys i finally found the configuration, i type find / -name httpd.conf - print there were three httpd.conf.
the other two httpd.conf, were bogus no configuration settings on it but the other one got configuration on the virtualhost.

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My advise with webhosting ! mitsch Solaris / OpenSolaris 1 11-04-2011 09:12 AM
WebHosting worldgnat Linux - Networking 2 04-30-2006 10:33 AM
Apache and webhosting simple NEWBIE QUESTION zetsui Linux - Software 9 08-01-2003 04:48 PM
Webhosting Help DragonHrt Linux - Newbie 1 03-27-2003 12:53 AM
Webhosting Help DragonHrt Linux - Software 3 03-26-2003 09:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration