Tag Archives: User Agent

Apache virtual host config vs global config problem

By freebird8z

Hi folks,

I am trying to configure Apache webserver and also a virtual host inside this webserver.

For Global server config: /var/www/html/index.html
For virtual host config: /var/www/virtual/index.html

Both client10 & www10 are pointing to 192.168.122.10 IP address.

BUT, MY Global webserver is also now pointing to virtual host’s home page. I am not sure how to prevent this. Can anyone help/advice to fix it?

thanks.

Code:

[root@client10 conf]# cat httpd.conf | egrep -v "^$|#|^BrowserMatch|^AddLanguage|^LoadModule|^AddIcon"
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000

StartServers 4
MaxClients 300
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

Listen 192.168.122.10:80
Include conf.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
ServerName client10.example.com:80
UseCanonicalName Off
DocumentRoot "/var/www/html"

Options FollowSymLinks
AllowOverride None

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow
Allow from 127.0.0.1

UserDir disabled

DirectoryIndex index.html index.html.var
AccessFileName .htaccess

Order allow,deny
Deny from all
Satisfy All

TypesConfig /etc/mime.types
DefaultType text/plain

MIMEMagicFile conf/magic

HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log combined
ServerSignature On
Alias /icons/ "/var/www/icons/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

DAVLockDB /var/lib/dav/lockdb

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

AllowOverride None
Options None
Order allow,deny
Allow from all

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset UTF-8
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/error/"

AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback

NameVirtualHost 192.168.122.10

ServerAdmin tony@www10.example.com
DocumentRoot /var/www/virtual
ServerName www10.example.com
ErrorLog logs/www10.example.com-error_log
CustomLog logs/www10.example.com-access_log common


…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Basic awk help

By sectech

Im sure this is an easy question, but Ive tried and tried to get this to print all on one line and cant figure out why its not, so maybe someone can help


awk '/AP/{sub(/:80/, "", $4);printf $4"t"} /User-Agent/{sub(/^[^:][^:]*:/,"");print}/Host/{sub(/^[^:][^:]*:/,"");print}'


What this prints is “AP” then “User-Agent” on one line(good) but then prints “HOST” on a separate line? How can I get all three to print on a single line?

Thanks!:confused:

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums