image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Design & Media

Reply
 
Thread Tools
  #1  
Old February 25th, 2005, 06:31 PM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
blackrose is on a distinguished road
setting up new user.conf file

I've currently got a PowerBookG4 1.3GHZ with OS X 10.3.8. I have turned on personal web sharing. I have successfuly been able to view files in the sites folder when I type in the PowerBooks name across the network. However what I'm looking to do is create create a new profile only for the apache server configuration as a test server. I will eventually install php and mysql for local use only, what I'd like to do is use the apache server configuration to test php scripts on my local machine. I would like it when I type in htp://localhost/~test/ to get the contents not of a sites folder within a users account but of a folder that I created elsewhere. I noticed in the .conf file for each user that is found at /Private/etc/httpd/users/(user name).conf a text statement like such:

<Directory "/Users/(user name)/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I was wondering how I could create something similar but for a "test" user and change the line that says: <Directory "/Users/(user name)/Sites/"> to a line that is closer to <Directory "/www/u/username/htdocs/"> because this is how the hosting company that I'm with (PowWeb) organizes each users files- u is replaced with the first letter of the master user and username is replaced with the actual username and htdocs is the actual web accessible folder. I've already created the apropriate directories. What I'm trying to do is test the php files which will have absolute "include" statements to files outside of the htdocs folder similar to
<?php include("/www/u/username/SideMenu.txt"); ?>

So If any one has any ideas on how to set this up it will gladly be appreciated.

Last edited by blackrose; February 25th, 2005 at 06:37 PM.
Reply With Quote
  #2  
Old March 4th, 2005, 10:12 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
If you have absolute include statements then a /much/ simpler way of going about it is this:

Code:
<?php
	 // This is index.php
	 require_once('paths.inc.php');
	 echo "<a href=\"" . $abs_path_prefix . $file_name . "\">Link name</a>";
?>

<?php
	 // This is paths.inc.php
	 $abs_path_prefix = "/www/u/username/htdocs/";
?>
Then just change your $abs_path_prefix when you deploy your site and all your links will work.
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iMac Aluminum 24" |
MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 01:42 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.