Sponsored Content
Top Forums Web Development servername in apache httpd.conf Post 302471247 by warpzero on Friday 12th of November 2010 10:26:46 AM
Old 11-12-2010
Depends on your webserver is setup. If you are using the VirtualHost directive for all the sites being hosted, then the ServerName parameter within httpd.conf can be the hostname of the machine as it isn't used. If you only have 1 site being hosted without VirtualHost then the ServerName is to reflect the site being hosted and would have to be a registered DNS name.

Mike
 

10 More Discussions You Might Find Interesting

1. IP Networking

defaults httpd.conf

I have found in the httpd.conf where it it states the default parse pages like index.htm, index.html, index.php and etc....However, my computer box does not seem to want to automatically load the index.php files. Anyone have any ideas? (5 Replies)
Discussion started by: macdonto
5 Replies

2. IP Networking

httpd.conf - stumped

Have been asked to remove all images from being logged to the access_log ... where am I going wrong?<VirtualHost 123.456.789.99> ServerName www.somedomain.com.au DocumentRoot /agents/tts Redirect /wap http://somewap.com.au/traveler LogFormat "%v %h %l %u %t \"%r\" %>s %b" comonvhost... (2 Replies)
Discussion started by: Cameron
2 Replies

3. UNIX for Dummies Questions & Answers

Apache httpd.conf <VirtualHost> issue

I have just configured httpd.conf on a new Redhat 9 install. Below are my additions to httpd.conf. Everything works fine except that when typing http://spetnik.d2g.com into my web browser, I am sent to the "Default catch all" site. Any clues? NameVirtualHost *:80 #Default catch all ... (5 Replies)
Discussion started by: Spetnik
5 Replies

4. Ubuntu

Apache 2 httpd.conf empty

Hi everybody, I have installed Apache 2 + Tomcat 5.5. on Ubuntu 7.04 and the default httpd.conf is empty (0 lines), however there is a file called apache2.conf that looks like a default httpd.conf. I didn't use Apache in ages, since 1.3.x release, but I remember that the httpd.conf by default... (2 Replies)
Discussion started by: sspirito
2 Replies

5. Red Hat

apache 2.2 httpd.conf

Hi, I was wondering if someone could help me out here. I am super-paranoid, so am trying to limit what PHP files can be executed on this server. I have a small list of files that I want to allow. The rest, deny. So I have base rule that denies all php files server-wide: order allow,deny ... (0 Replies)
Discussion started by: Lobster
0 Replies

6. Red Hat

apache 2.2 httpd.conf

Hi, I was wondering if someone could help me out here. I am super-paranoid, so am trying to limit what PHP files can be executed on this server. I have a small list of files that I want to allow. The rest, deny: <Files ~ "\.(php|php3)$"> order allow,deny deny from all </Files> I... (0 Replies)
Discussion started by: Lobster
0 Replies

7. UNIX for Dummies Questions & Answers

Locate which httpd.conf is used by Apache

What is the command to see what httpd.conf file is apache using. Apache is started. (1 Reply)
Discussion started by: galford
1 Replies

8. Shell Programming and Scripting

Playing with httpd.conf

Hello Guys !! wanted to use SED to pull cout the full vertualhost entry for domain which is specified from command line Like (IP base httpd.conf) domain="ServerName takemewithyou.in" sed -n '/<VirtualHost* $domain/,/<\/VirtualHost>/p' httpd.conf File can take to test is below ... (0 Replies)
Discussion started by: SilvesterJ
0 Replies

9. Shell Programming and Scripting

Search and comment block of text from apache httpd.conf

I want to search for a block of text in httpd.conf that between two strings and comment it. There are multiple blocks with "<Directory.. and </Directory>" <Directory "${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/htdocs"> # # Possible values for the Options directive are... (3 Replies)
Discussion started by: kchinnam
3 Replies

10. Red Hat

Httpd.conf Config?

hi is it possible ? explain tome about below items StartServers 8 MinSpareServers 10 MaxSpareServers 20 ServerLimit 4000 MaxClients 4000 MaxRequestsPerChild 4000 this is my servers 8gig ram & cpu 12 core... what cann i putting in order this ? tnx (1 Reply)
Discussion started by: mnnn
1 Replies
libapache2-mod-perl2-2.0.7::docs::api::Apache2::DirectivUsermContributed Perl Documelibapache2-mod-perl2-2.0.7::docs::api::Apache2::Directive(3pm)

NAME
Apache2::Directive - Perl API for manipulating the Apache configuration tree Synopsis use Apache2::Directive (); my $tree = Apache2::Directive::conftree(); my $documentroot = $tree->lookup('DocumentRoot'); my $vhost = $tree->lookup('VirtualHost', 'localhost:8000'); my $servername = $vhost->{'ServerName'}; use Data::Dumper; print Dumper $tree->as_hash; my $node = $tree; while ($node) { print $node->as_string; #do something with $node my $directive = $node->directive; my $args = $node->args; my $filename = $node->filename; my $line_num = $node->line_num; if (my $kid = $node->first_child) { $node = $kid; } elsif (my $next = $node->next) { $node = $next; } else { if (my $parent = $node->parent) { $node = $parent->next; } else { $node = undef; } } } Description "Apache2::Directive" provides the Perl API for manipulating the Apache configuration tree API
"Apache2::Directive" provides the following functions and/or methods: "args" Get the arguments for the current directive: $args = $node->args(); obj: $node ( "Apache2::Directive object" ) ret: $args ( string ) Arguments are separated by a whitespace in the string. since: 2.0.00 For example, in httpd.conf: PerlSwitches -M/opt/lib -M/usr/local/lib -wT And later: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('PerlSwitches'); my $args = $node->args; $args now contains the string "-M/opt/lib -M/usr/local/lib -wT" "as_hash" Get a hash representation of the configuration tree, in a format suitable for inclusion in <Perl> sections. $config_hash = $conftree->as_hash(); obj: $conftree ( "Apache2::Directive object" ) The config tree to stringify ret: $config_hash ( HASH reference ) since: 2.0.00 For example: in httpd.conf: <Location /test> SetHandler perl-script PerlHandler Test::Module </Location> And later: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('Location', '/test/'); my $hash = $node->as_hash; $hash now is: { 'SetHandler' => 'perl-script', 'PerlHandler' => 'Test::Module', } "as_string" Get a string representation of the configuration node, in httpd.conf format. $string = $node->as_string(); obj: $node ( "Apache2::Directive object" ) The config tree to stringify ret: $string ( string ) since: 2.0.00 For example: in httpd.conf: <Location /test> SetHandler perl-script PerlHandler Test::Module </Location> And later: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('Location', '/test/'); my $string = $node->as_string; $string is now: SetHandler perl-script PerlHandler Test::Module "conftree" Get the root of the configuration tree: $conftree = Apache2::Directive::conftree(); obj: "Apache2::Directive" ( class name ) ret: $conftree ( "Apache2::Directive object" ) since: 2.0.00 "directive" Get the name of the directive in $node: $name = $node->directive(); obj: $node ( "Apache2::Directive object" ) ret: $name ( string ) since: 2.0.00 "filename" Get the filename the configuration node was created from: $filename = $node->filename(); obj: $node ( "Apache2::Directive object" ) ret: $filename ( string ) since: 2.0.00 For example: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('VirtualHost', 'example.com'); my $filename = $node->filename; $filename is now the full path to the httpd.conf that VirtualHost was defined in. If the directive was added with "add_config()", the filename will be the path to the httpd.conf that trigerred that Perl code. "first_child" Get the first child node of this directive: $child_node = $node->first_child; obj: $node ( "Apache2::Directive object" ) ret: $child_node ( "Apache2::Directive object" ) Returns the first child node of $node, "undef" if there is none since: 2.0.00 "line_num" Get the line number in a filename this node was created at: $lineno = $node->line_num(); obj: $node ( "Apache2::Directive object" ) arg1: $lineno (integer) since: 2.0.00 "lookup" Get the node(s) matching a certain value. $node = $conftree->lookup($directive, $args); @nodes = $conftree->lookup($directive, $args); obj: $conftree ( "Apache2::Directive object" ) The config tree to stringify arg1: $directive ( string ) The name of the directive to search for opt arg2: "args" ( string ) Optional args to the directive to filter for ret: $string ( string / ARRAY of HASH refs ) In LIST context, it returns all matching nodes. In SCALAR context, it returns only the first matching node. If called with only $directive value, this method returns all nodes from that directive. For example: @Alias = $conftree->lookup('Alias'); returns all nodes for "Alias" directives. If called with an extra $args argument, it returns only nodes where both the directive and the args matched. For example: $VHost = $tree->lookup('VirtualHost', '_default_:8000'); since: 2.0.00 "next" Get the next directive node in the tree: $next_node = $node->next(); obj: $node ( "Apache2::Directive object" ) ret: $next_node ( "Apache2::Directive object" ) Returns the next sibling of $node, "undef" if there is none since: 2.0.00 "parent" Get the parent node of this directive: $parent_node = $node->parent(); obj: $node ( "Apache2::Directive object" ) ret: "parent_node" ( "Apache2::Directive object" ) Returns the parent of $node, "undef" if this node is the root node since: 2.0.00 See Also mod_perl 2.0 documentation. Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. Authors The mod_perl development team and numerous contributors. perl v5.14.2 2011-02-08 libapache2-mod-perl2-2.0.7::docs::api::Apache2::Directive(3pm)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy