• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

I need help with Linux hostname resolution

Shodan99

New Member
Joined
Mar 11, 2009
Messages
25 (0.01/day)
Likes
0
Location
Largo, Florida
System Name Shodan (Japanese for "Little Master")
Processor AMD PhenomII X6 Black
Motherboard MSI 890FXA-GD7
Cooling Corsair H70
Memory 4x 2GB Corsair Dominator
Video Card(s) 2x RadeonHD 5770
Storage 2x 1TB Barracuda SATA HDD
Display(s) ACER 23" HD LED
Case Antec Three-Hundred
#1
I set up a new linux server and I am trying to get all my websites up and running again. I have all the DNS pointed to my server but cant get them to pull up specific directorys

ie:
var/www/html/site1
var/www/html/site2

they all go to the same directory and bring up
var/www/html

how do i get that extra step to pull up the right directory for the right website? is it something in the files
/etc/hosts
/etc/host.conf
/etc/resolv.conf
and if so what do i need to enter to get my domain to pull up the right index file?
 

Shodan99

New Member
Joined
Mar 11, 2009
Messages
25 (0.01/day)
Likes
0
Location
Largo, Florida
System Name Shodan (Japanese for "Little Master")
Processor AMD PhenomII X6 Black
Motherboard MSI 890FXA-GD7
Cooling Corsair H70
Memory 4x 2GB Corsair Dominator
Video Card(s) 2x RadeonHD 5770
Storage 2x 1TB Barracuda SATA HDD
Display(s) ACER 23" HD LED
Case Antec Three-Hundred
#2
Anybody? I could use some help here.
 
Joined
Sep 25, 2006
Messages
2,312 (0.56/day)
Likes
670
Location
Norn Iron
Processor Q9550 @3.8
Motherboard Asus Maximus Extreme
Cooling Custom water cooling
Memory 4GB Patriot Viper DDR3 1600MHz
Video Card(s) 2x HD4870 512MB
Storage 2x 500GB
Display(s) 3x LG L226WTQ 22" Widescreen LCD
Case Modded TJ07
Audio Device(s) On board
Power Supply PC P&C Silencer 750
Software Windows 7 Ultimate
#3
Are you using Apache or what web server ?

You can set the folder that each site uses in its config IIRC
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
17,170 (3.43/day)
Likes
18,146
Processor Core i7-4790K
Memory 16 GB
Video Card(s) GTX 1080
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 7
#4
you need apache virtual hosts, stuff like

Code:
<VirtualHost 208.43.3.xx:80 10.18.50.xx:80>
ServerAdmin admin@techpowerup.com
[B]DocumentRoot /home/xx/www[/b]
ServerName [B]www.generalnonsense.net[/B]
ServerAlias [B]generalnonsense.net *.generalnonsense.net[/B]
ErrorLog /home/xx/logs/www.xx.net_error_log
CustomLog /home/xx/logs/www.generalnonsense_access_log combined

RewriteEngine On
RewriteCond %{HTTP_HOST}        !www.generalnonsense.net
RewriteRule ^/(.*)$ http://www.generalnonsense.net/$1 [L,R=301]
</VirtualHost>
in your apache config file. location depends on your linux distro .. /etc/httpd/conf/httpd.conf on centos/redhat/fedora
 
Last edited: