Sponsored Content
Top Forums Web Development $_SERVER['DOCUMENT_ROOT'] directs to /var/www not ~/public_html Post 302906590 by Neo on Saturday 21st of June 2014 02:15:06 AM
Old 06-21-2014
You can use the Apache2 DocumentRoot directive to set the document root.

Perhaps you should search on line and find a basic working example of setting up your Apache2 config files?

Most Linux distributions have easy step-by-step LAMP set up instructions. Which Linux distribution are you using?
This User Gave Thanks to Neo For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

chmod for public_html ?

Hello! My web host has the public_html permission on my account set to 750. 1. Does this setting permit the world to use my submission forms (contained within contact.html and purchase_order.html)? 2. The "0" entry looks like it blocks the public from conducting all activity on my site.... (6 Replies)
Discussion started by: Texan
6 Replies

2. UNIX for Advanced & Expert Users

resize /var/www (debian)

I have several live websites running in the /var/www/XXXX directory. Initially when I did the Debian install I limited the web directory to 6GB. I am now outgrowing that limit. Question is: Is there a simple way to add space to the web directory??? I'd hate to have to redo the whole... (3 Replies)
Discussion started by: seagonus
3 Replies

3. Web Development

var/www/html permissions

Hi, first post. I have no Linux experience. I have an e-friend that set me up a VPS and my website with Apache and FTP access so I could upload my files the way I do it regularly with my shared hosting. The OS in the VPS is Fedora by the way. Now the thing is: http ://www.mydomain.com presents... (0 Replies)
Discussion started by: JPA
0 Replies

4. UNIX for Dummies Questions & Answers

Permissions of the folder var/www

what should be the permissions of the folder var/www in my ubuntu ? I need it to be safe and at the same time I need ftp users to be able to edit it. I was wondering if I should create a group with all permissions and add ftp users to this group in unix. what's the standard way to do it ?... (4 Replies)
Discussion started by: aneuryzma
4 Replies

5. UNIX for Dummies Questions & Answers

Granting user permission for public_html

I have problem giving user access to his public_html directory. While when I am logged as root I can access my files by going to www.myserver.com/file.htmlwhere file.html is actually on this path... var/www/file.htmlBut when user tries to access his file.html on this path.... ~user/file.html it... (10 Replies)
Discussion started by: joker40
10 Replies

6. UNIX for Dummies Questions & Answers

How to protect directory var/www in debian?

hi i need somme help to protect directory in debian with user and pass var/www thank's (6 Replies)
Discussion started by: azzeddine2005
6 Replies

7. Debian

Help request. FTP user to var/www/html

Hi all. I appologise this is my first post, I will gladly have a further look around to see if this has been posted elsewhere, but so far it has not, or it doesnt quite explain in full what I need. If anyone here can help me out, I would really appreciate this. I want to make sure I do this... (1 Reply)
Discussion started by: Pinkfloyd
1 Replies

8. Web Development

Botnet Map from $_SERVER[HTTP_REFERER]

4000 node Botnet derived from PHP superglobal $_SERVER mapped with Google Maps Engine. https://www.unix.com/members/1-albums112-picture640.png total ips 54945 unique ips 4000 unique countries 64 (2 Replies)
Discussion started by: Neo
2 Replies
install::TempContent::Objects::mod_perl-2.0.9::docs::apiUseraContriinstall::TempContent::Objects::mod_perl-2.0.9::docs::api::Apache2::Directive(3)

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.18.2 install::TempContent::Objects::mod_perl-2.0.9::docs::api::Apache2::Directive(3)
All times are GMT -4. The time now is 11:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy