The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   point apache to a folder (http://hintsforums.macworld.com/showthread.php?t=87737)

tlarkin 03-25-2008 04:27 PM

point apache to a folder
 
OK,

So, I don't know how I forgot to do this in OS X, but I guess I need to edit the /etc/httpd/httpd.conf file to point it to a particular folder?

I downloaded an open source web based front end for a mysql database driven ticketing system. I just need to point apache to that folder and then run the interactive web based set up.

So, how do I point apache to this folder? I already have msyql, php, and apache installed and running.

Thanks in advance

hayne 03-25-2008 06:33 PM

I'm not sure, but I think what you are looking for is the DocumentRoot variable in httpd.conf

tlarkin 03-25-2008 07:36 PM

I am not sure either. I downloaded this FOSS inventory software and I have apache, php, perl, and mysql all installed and running on my mac. The instructions just say untar the folder into the root folder of your web server and then open up a a web browser and type in the url, so like localhost/folder and it will then bring up an interactive web based set up page which you use to finish the installation.

hayne 03-25-2008 08:53 PM

Quote:

Originally Posted by tlarkin (Post 460280)
The instructions just say untar the folder into the root folder of your web server

The DocumentRoot variable in httpd.conf specifies the "root folder of your web server". By default it is /Library/WebServer/Documents if I recall correctly.
Is that where you untarred the software?

acme.mail.order 03-25-2008 11:06 PM

You have 3 choices:

1. move the installed web app to /Library/WebServer/Documents and access it from http://localhost/foldername

2. move the installed web app to Home -> Sites and access it from http://localhost/~yourusername/foldername (note the ~ before your user name)

3. put the installed web app anywhere and edit httpd.conf file. Change the DocumentRoot to the full path to the web app, minus the final /
You must restart Apache after making this change, or reboot the machine.

Option 2 is the easiest and most accessable - doesn't require fiddling with system-level folders and lengthy config files.

acme.mail.order 03-25-2008 11:09 PM

Quote:

Originally Posted by tlarkin (Post 460239)
I already have msyql, php, and apache installed and running.

This is slightly worrying, as these programs are pre-installed. Did you download apache and php?

tlarkin 03-25-2008 11:35 PM

Quote:

Originally Posted by acme.mail.order (Post 460326)
This is slightly worrying, as these programs are pre-installed. Did you download apache and php?

I downloaded XAMPP for OS X, which is an application that turns on the built in features that are already there and adds the ones that aren't.

On another machine I just downloaded MySQL since OS X does not by default have it on the client software, but OS X server does.

acme.mail.order 03-26-2008 12:13 AM

Ok, that shouldn't break anything. Which URL form do you want?

12.34.56.78/folder
servername.org/folder
servername/~tlarkin/folder

tlarkin 03-26-2008 12:26 AM

well this is purely for testing, so it doesn't matter though I think there are some folders that need -r-x permissions for everyone in this package.

Once testing is done and if we decide it is good enough to keep, I will probably migrate this to a dedicated machine for the sole purpose of running that ticket system. So, eventually it will have a static IP and I will have our network managers give me a domain name so I can just go www.ticketsystem.org (for example) and add it to our internal domains.

For now, I can just toss it in the local admin's home folder for the mac mini that is hosting it to test it out.

Thanks for the help, I am used to linux where it is a lot of times in /var/www

I suppose it doesn't matter where it lives since you can modify it to live anywhere but I would rather keep it where it is suppose to live for now. I have never actually done any web hosting ever on a Mac, so this is kind of new to me. I have ran Apache on Linux and Windows before though.

Thanks for your help, it is appreciated. Unfortunately the people that mainly develop this product are from another non english speaking country so their website can be hard to navigate and their forum only has one section for english speaking users. However, it looks like a very nice product and the price is outstanding, since it is 100% free and open source!

tlarkin 03-26-2008 10:36 AM

I unpacked the web app and tossed it in /Library/WebServer/Documents/glpi

then I restarted Apache, and when I access http://localhost/glpi I get nothing...........:confused:

tlarkin 03-26-2008 01:48 PM

here is the how to on Debian Linux if anyone can toss me some pointers, they seem to have no OS X documentation and when I posted on their forum they said when I figure it out I can add it to their Wiki, lol

http://glpi-project.org/wiki/doku.php?id=en:glpignu

So, any suggestions would be super greatly appreciated

Thanks

Mikey-San 03-26-2008 02:09 PM

Out of curiosity, did you edit /etc/apache2/httpd.conf? That's the main config file for Apache 2, which is the web server in Leopard.

tlarkin 03-26-2008 02:14 PM

Quote:

Originally Posted by Mikey-San (Post 460434)
Out of curiosity, did you edit /etc/apache2/httpd.conf? That's the main config file for Apache 2, which is the web server in Leopard.

Nope, I left it as default and tossed the web package in /Library/WebServer/Documents

I am running Tiger as well, 10.4.11. I could put Leopard on the machine, I have plenty of extra licenses for Leopard and Leopard server.

Mikey-San 03-26-2008 03:01 PM

Oops. I meant to ask also if it was Leopard. Otherwise, what I said isn't true. :)

Mikey-San 03-26-2008 03:02 PM

When you say:

Quote:

then I restarted Apache, and when I access http://localhost/glpi I get nothing...........
What's the actual error in the browser?

tlarkin 03-26-2008 04:40 PM

Quote:

Originally Posted by Mikey-San (Post 460443)
When you say:



What's the actual error in the browser?

404 file not found

pfraterdeus 03-26-2008 04:59 PM

What do you get without the 'glpi'?
 
Quote:

Originally Posted by tlarkin (Post 460458)
404 file not found

It should show you the Apache default page at http://localhost/

"Seeing this instead of the website you expected?"

If not, there's some other issue with the httpd.conf, DocumentRoot, or elsewhere.

If you do see this, I'd start by making sure the 'glpi' directory is readable.

Try this in Terminal:

ls -la /Library/Webserver/Documents

and let's see the results.

acme.mail.order 03-26-2008 08:28 PM

Go for a file directly:
http://localhost/glpi/index.php

I don't recall if the default conf file looks for index.php or not.

tlarkin 03-27-2008 09:47 AM

If I just do a http://localhost I get the XAMPP index page by default. Perhaps when I installed XAMPP it modified the httpd.conf file? This is my first time running XAMPP, and was recommended it because of how easy it made everything.

tlarkin 03-27-2008 11:45 AM

Here goes the contents of the webserver folder

Code:

testmini:/Library/WebServer/Documents/glpi admin$ ls -al /Library/WebServer/Documents/
total 360
drwxrwxr-x  39 root  admin  1326 Mar 26 09:34 .
drwxrwxr-x    5 root  admin    170 Mar 26 09:34 ..
-rw-rw-r--    1 admin  admin  6148 Mar 26 09:34 .DS_Store
-rw-rw-r--    1 root  admin  3726 Apr 24  2007 PoweredByMacOSX.gif
-rw-rw-r--    1 root  admin  31958 Apr 24  2007 PoweredByMacOSXLarge.gif
-rw-rw-r--    1 root  admin  2326 Jul  3  1996 apache_pb.gif
drwxrwxrwx  26 admin  admin    884 Mar 25 09:50 glpi
-rw-rw-r--    1 root  admin  1884 Jun 26  2001 index.html.ca
-rw-rw-r--    1 root  admin  1025 Feb 15  2005 index.html.cn
-rw-rw-r--    1 root  admin  1583 Jun 27  2001 index.html.cz
-rw-rw-r--    1 root  admin  2274 Sep 17  2001 index.html.de
-rw-rw-r--    1 root  admin  1557 Jun 27  2001 index.html.dk
-rw-rw-r--    1 root  admin  1877 Jun 27  2001 index.html.ee
-rw-rw-r--    1 root  admin  1677 Jun 27  2001 index.html.el
-rw-rw-r--    1 root  admin  1456 May  3  2001 index.html.en
-rw-rw-r--    1 root  admin  1799 Jun 27  2001 index.html.es
-rw-rw-r--    1 root  admin  1525 Jun 27  2001 index.html.fr
-rw-rw-r--    1 root  admin  3706 Jun 27  2001 index.html.he.iso8859-8
-rw-rw-r--    1 root  admin  2585 Feb  2  2004 index.html.hu
-rw-rw-r--    1 root  admin  1847 Nov  7  2001 index.html.it
-rw-rw-r--    1 root  admin  1799 Dec 13  2001 index.html.ja.jis
-rw-rw-r--    1 root  admin  1316 Feb 15  2005 index.html.kr.iso-kr
-rw-rw-r--    1 root  admin  1896 May 21  2002 index.html.lb.utf8
-rw-rw-r--    1 root  admin  2007 Jun 28  2001 index.html.nl
-rw-rw-r--    1 root  admin  1534 Sep  6  2001 index.html.nn
-rw-rw-r--    1 root  admin  1526 Jun 28  2001 index.html.no
-rw-rw-r--    1 root  admin  1497 Jun 28  2001 index.html.po.iso-pl
-rw-rw-r--    1 root  admin  1842 Jun 28  2001 index.html.pt
-rw-rw-r--    1 root  admin  2035 Mar 21  2001 index.html.pt-br
-rw-rw-r--    1 root  admin  1591 Jun 28  2001 index.html.ru.cp-1251
-rw-rw-r--    1 root  admin  1585 Jun 28  2001 index.html.ru.cp866
-rw-rw-r--    1 root  admin  1589 Jun 28  2001 index.html.ru.iso-ru
-rw-rw-r--    1 root  admin  1585 Jun 28  2001 index.html.ru.koi8-r
-rw-rw-r--    1 root  admin  3134 Jan 27  2001 index.html.ru.ucs2
-rw-rw-r--    1 root  admin  6268 Jan 27  2001 index.html.ru.ucs4
-rw-rw-r--    1 root  admin  2318 Jun 28  2001 index.html.ru.utf8
-rw-rw-r--    1 root  admin  1700 Jun 28  2001 index.html.se
-rw-rw-r--    1 root  admin  1130 Feb 15  2005 index.html.zh-tw.big5
lrwxr-xr-x    1 root  admin    38 Jul  7  2007 manual -> /Library/Documentation/Services/apache
testmini:/Library/WebServer/Documents/glpi admin$

Do I need to change ownership of that folder to root:wheel?

Err I mean root:admin

tlarkin 03-27-2008 04:11 PM

OK

Well, I got to get a bit more familiar with XAMPP today. It seems that when you install XAMPP it puts this on your Mac:

Quote:

Apache 2.2.8, MySQL 5.0.51, PHP 4.4.8, PHP 5.2.5, Perl 5.10.0, ProFTPD 1.3.0a, phpMyAdmin 2.11.4, OpenSSL 0.9.8e, GD 2.0.35, Freetype 2.3.5, libjpeg 6b, libpng 1.2.18, libungif-4.1.4, zlib 1.2.3, expat 2.0.1, Ming 0.3, Webalizer 2.01-10, pdf class 009e, mod_perl 2.0.3, SQLite 3.4.0, phpSQLiteAdmin 0.2, libiconv-1.11, gdbm-1.8.3, libxml-2.6.29, libxslt-1.1.21, openldap-2.3.36, imap-2004g, gettext-0.16.1, libmcrypt-2.5.8, mhash-0.9.9, curl-7.16.4, zziplib-0.10.82, bzip2-1.0.3, freetds-0.64
MD5 checksum: 22d7cc3878c510ff809593d712d0f8c9
All in one nice little package, it also puts the root apache web folder in /Applications/XAMPP/htdocs

It puts MYSQL in /Applications/XAMPP/etc


So, I move the glpi folder into that directory and it lives there. Now, when I try to run the interactive set up, I still get no dice, but this time its a different error message.

Internal server error or misconfiguration

Which before I was getting 404. So, it seems that it sees the document there, but it can't load it....

Still trying to figure it out, and I think I like XAMPP, but I should have read all the documentation first. I guess I should have also known better to read all the documentation first, but hey, I am an IT worker, and I only read manuals if I can't figure it out first few tries hahaha.

I will post when I figure out exactly whats up with it.

Thanks to everyone who helped

acme.mail.order 03-27-2008 11:45 PM

Oy gevalt. So you installed an alphabet soup of programs and now you've got config errors.

Is it a 500 http error? Most common cause of those is misconfigured perl CGI files/folders. Check the execute bits, shebang line for proper path, and that the directory has exec-cgi enabled.

tlarkin 03-28-2008 10:01 AM

ah well here is a screen shot

http://img329.imageshack.us/img329/3697/picture1fe9.jpg

All that is needed, or should be needed, is load XAMPP, then toss the folder into the xamp/htdocs and be done with it.

From my understanding, XAMPP does not alter any default configurations but it just links apache to its web folder as well as the default in OS X.

tlarkin 03-28-2008 02:11 PM

I am wiping the mini clean and loading leopard server on there, which has all of that stuff native. I will report back. A guy on the apache forum was baffled why it wouldn't work either.

I am sure I screwed something up, but no one can figure out what...

tlarkin 03-28-2008 03:33 PM

update
 
well leopard server up and running along with everything I need natively installed.

Added the GLPI folder into /Library/WebServer/Documents and when I access http://localhost/glpi it downloads the config file.

Do, I need to change the htaccess file in GLPI?

I did a chmod 777 to the glpi directory since it does say in the documentation you need fulll access to some files in there.

acme.mail.order 03-28-2008 07:46 PM

htaccess wont do what you are describing. Is this thing written in perl or php? If perl, do files have the execute bit set? If PHP, did you enable the php module? Don't remember if it's on by default or not.

tlarkin 03-29-2008 03:17 PM

It is PHP based, and I think with the new leopard control panel you can go in and manually turn on whatever services you want in the web service and I am almost certain I have PHP running....

Will double check on Monday.

Thanks.

acme.mail.order 03-30-2008 06:30 AM

Ok, so can you load a phpinfo file properly? And what happens when you go for a random file directly rather than a directory? In all the examples above you try to get http://localhost/glpi which I'm guessing is a folder. This needs an Apache redirect to http://localhost/glpi/ to even begin to work properly, and another internal function to get http://localhost/glpi/index.php

tlarkin 03-31-2008 10:37 AM

If I try to load the index safari just downloads the file, every time I access the file it just downloads it in text format.....:confused:

acme.mail.order 03-31-2008 07:24 PM

so http://localhost/glpi/index.php shows you the source code? That's easy - PHP isn't running. Check the httpd.conf file and restart Apache.

tlarkin 04-01-2008 11:12 AM

Well, I took all the #s out of the httpd.conf file to allow for PHP to load and run and I still have the same errors.

I do see in Leopard some things are changed and a lot of this is configured via server admin. I created a new page in server admin and put the path as /Library/WebServer/Documents/glpi and gave it a name, and allowed it permission to run, and turn all options on for it, and listed either html.index or php.index as the default page.

I am not sure exactly where to go from here....Why is this so hard lol?


All times are GMT -5. The time now is 09:44 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.