• 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.00/day)
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
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.00/day)
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
Anybody? I could use some help here.
 
Joined
Sep 25, 2006
Messages
2,312 (0.36/day)
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
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
27,049 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
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:
Top