-
Website
http://www.zaphu.com/ -
Original page
http://www.zaphu.com/2007/08/21/ubuntu-lamp-server-guide-configure-apache-mysql-and-cgi-bin/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Riley Porter
2 comments · 2 points
-
7thKnife
2 comments · 1 points
-
ludicrous50
2 comments · 1 points
-
jkhintoncpbd
2 comments · 1 points
-
0chiehchen
2 comments · 1 points
-
-
Popular Threads
Respectfully,
Sonny
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
Should I add a new paragraph with something like:
ScriptAlias /cgi-bin/ /home/USERNAME/public_html/cgi-bin/
<Directory /home/USERNAME/public_html/cgi-bin/>
Options ExecCGI
AddHandler cgi-script cgi pl
</Directory>
Or should I edit the existing paragraph on my modified "default" file to look a bit like this:
######################3
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ /home/USERNAME/Public/cgi-bin/
## <Directory "/usr/lib/cgi-bin"> # old
<Directory "/home/USERNAME/Public/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
## Added per zaphu
AddHandler cgi-script cgi pl
Order allow,deny
Allow from all
</Directory>
* Starting web server apache2 Syntax error on line 20 of /etc/apache2/sites-enabled/whatever_you_want_to_call_profile:
ScriptAlias takes two arguments, a fakename and a realname
Adding the suggested verbiage as a new paragraph below the default profile's ScriptAlias paragraph also didn't fly:
[warn] The ScriptAlias directive in /etc/apache2/sites-enabled/zaphu at line 46 will probably never match because it overlaps an earlier ScriptAlias.
I'll just blow away my newly minted local cgi directory and use the default ones in /usr/lib (if I ever get to the point where I'm using CGI) unless I can find clear instructions.
It seems like merely commenting something out doesn't make it disappear as far as apache is concerned, very odd, there were times I had to remove lines to get the profile to work.
Do you have to disable the webserver with "/etc/init.d/apache2 stop" and disable the profile with "a2dissite PROFILE_NAME" in order to edit your profile, then enable it again with "a2ensite PROFILE_NAME" and bring up the server with "/etc/init.d/apache2 start" to test your changes? Anyway, that's what I did. It would be easier if you could just edit the file of an active PROFILE and then simply reload the web server with "/etc/init.d/apache2 restart".
BTW, one thing I would mention in a tutorial like this is that you have to set the right permissions for served files to be visible with a browser. I had to use a command like this from a terminal as a regular user:
chmod -R a+xr ~/Public/
Chmod changes permissions, "-R" makes it recursive (descends in to sub-directories), "a" means 'change this permission for ALL, "+rx" adds read and execute privileges (the later allows you to see into sub-folders).
A little knowledge is a dangerous thing...
Thanks,
DWRZ
Top job. Thanks a bundle.
/public_html/site1
/public_html/site2
/public_html/site3
do i have to repete steps to add my sites to /etc/apache2/sites-available & then to create the config file for each of it & edit the path?
Thanks in advanced.
I have a question you may be able to help me with. I want to be able to run an in-house blog behind our router (with 5 computers running in the house, this isn't as crazy as it seems). I successfully installed WordPress on my new LAMP server, but when I try to view it from another machine, there is an error, even though I can see the default files in the home directory. What seems to be happening is that as the server serves the WordPress page, the URL is being converted from the IP address to 'localhost' which is fine when I'm working on the server machine, but not so fine when I try to view it from another box. If this is a WordPress problem, I'll look elsewhere. THANK YOU for a really well-written article, I'll be back to read more.
I am having the same problem (i.e. wp not accessible except on server machine because URL keeps switching localhost... on other machine).
Would you let me know what the settings were?
Thanks in advance,
thanks a lot. I found that to be the problem. Blog address had localhost. Stupid error when setting it up a while ago...
Irene
I've followed your tutorial to the letter (apart from installing gui)
and when I do "sudo aptitude install phpmyadmin"
I'm told that the dependency php5mcryp is uninstallable...
please help!
localhost/phpmyadmin. If this doesn't work, go back over the step 1 to make sure you didn't miss something. Check that thephpmyadminscript is located in/var/www/and make sure that the site's configuration file in/etc/apache2/sites-available/directory has an aliias pointing to thephpmyadminscript as per the directions in step 2.ServerName www.trial.com
ServerAlias trial.com
ServerAdmin webmaster@trial.com
# DocumentRoot /home/railsfactory/trial/
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ProxyPass / balancer://railsapp/
ProxyPassReverse / balancer://railsapp/
ErrorLog /var/log/apache2/error.log
# Log Level
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
the above is what i configured, but while browsing i have to type http://127.0.0.1:3000 but not http://127.0.0.1, why is that? can someone help me..
The only thing I can think of is that somewhere in the first install I must have "fat-fingered" something.
Thanks again,
By far and the way the easiest tutorial pair I've found on the basics of installing and setting up a LAMP. It was extremely straight forward for me (with the exception of the installation detecting my keyboard wrong, leading to all sorts of weird effects.
I might have made one change: instead of using Vi as the editor of choice, due to its complex way of editing files that's slightly intimidating for the newly initiated, I would have used Nano which is more straight forward.
Aside from that, you did a fantastic job!
Thanks,
Andrew
Thanks, Bob
sudo aptitude install apache2in the terminal.i am trying to follow trying to set an apache server.. and followed all the steps. Apache seems to work fine as i can run html files in my site directory using mozilla. But the problem is with cgi.
CGI files are not working. i even changed the permissions to 777 for my site directory, cgi-bin directory and even for .cgi file
Error log says
[Wed Feb 20 20:41:55 2008] [error] [client 192.168.1.25] (8)Exec format error: exec of '/home/biflab/str_db/cgi-bin/abc.cgi' failed
[Wed Feb 20 20:41:55 2008] [error] [client 192.168.1.25] Premature end of script headers: abc.cgi
Please help... thanks for this wonderful guide.
Did another complete install and still did not see the LAMP server selection. When the first batch of files loaded and the disk ejected I ran sudo tasksel install lamp-server and finally got LAMP installed. Then followed your LAMP configuration guide. Appears to works fine using this method. Thanks for your help.
Bob
Linux seems to be great, the opensource concept seems to be great, the quality and stability surprised me way over what i expected, but i was getting tired of reading too much techno crap wich is made (written) for people who already understand this OS. I on the other hand used windows for over 20 years (set up a few networks in the process, with XP and Window Server) considering myself with some network knowledge and a power computer user. So i was optimistic regarding the fact that i had to learn a new OS and all the new way of handling things, but was very quickly loosing all my initial enthusiasm and joy. You site gave me new courage to continue my quest for the free world. And i really mean this seriously. This is an awesome site and the way you write is greatly appreciated bye people like me i suppose and many many more.
My really truly congratulations for this huge amount of information and work that you put online for all of us. I hope and wish you all the luck in the world.
Thanks for the help!!
Thanks!
really helpful
I used to have a webserver running fine. But after upgrading to ubuntu 8.04 (from 7.10), my webserver is not functioning well. When i used http://127.0.0.1/ it displays "It Works"
But then when I try http://localhost/, it will browse (in the status bar) http://www.localhost.com/ and returns an error like 'server cannot be contacted" or something like that.
Please help me with this. What files should I edit and how would i edit them? I mean what changes should I make?
Im using Ubuntu 8:04LTS
Thank you.
Best regards,
Jess
/etc/hostsfile. Open it up. there should be a line that reads127.0.0.1 localhost. If there isn't then add it. If there is an additional line that looks like ::1 localhost, comment it out. This line could be in the hosts file because you have the IPV6 network module installed. You may need to remove these. I hope this helps.Cheers mate
I have gone through a kazillion sites and cannot seem to resolve the issue I am having. Seeing how this is the most informative posting I have come across I will try my luck here.
NO MATTER what I try and which userid I try it under I cannot get connected to the mysql database.
I CAN connect using: mysql -u sa ~after which I can "show" but never edit.
I need to change the root password, or at least add another account that I can setup a db to use for phpbb...but no method seems to work with mysql or mysqladmin.
Any thoughts?
Thanks, Bill
kudos to Sam
A million thanks for putting this out there. This was a very clear path for this ubuntu newbie to follow.
Index of /
Name Last modified Size Description
--------------------------------------------------------------------------------
Index.html 06-Jul-2008 23:10 50
--------------------------------------------------------------------------------
Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5 with Suhosin-Patch Server at 192.168.1.3 Port 80
I'm using ubuntu server 8.04
just wanting to know why it doesnt go straight into that index.html file i created?
Also how do i go about putting this page on the www? are there any tutorials on this or information i could get on it?
nvm all is fine now and i can see my page on the net by its wan ip address :D i know what i need to do now. thanks for the help a great guide you have written.
The message I get is "xxx.xxx.xxx.xxx has sent an incorrect or unexpected message. Error Code:-12263". When I clicked "ok" on the message it took me to the webmin manager. In another browser I got the message "Safari can’t open the page “http://xxx.xxx.xxx.xxx/phpmyadmin” because it couldn’t establish a secure connection to the server “xxx.xxx.xxx.xxx”."
In the webmin panel under the apache server configuration file, when I inserted the "Include" and "Alias" links at the end of the file / page, and then returned to the apache server management panel, and selected "Apply Changes" I got the following error message "[Fri Aug 29 22:59:28 2008] [warn] The Alias directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias. Syntax error on line 301 of /etc/apache2/apache2.conf: Alias takes two arguments, a fakename and a realname"
I don't understand what to do here. When I follow the php link, what page am I supposed to see? is it the webmin panel? And what do I do about the error messages?
thank you very much
Thanks alot for taking the time to write em..
Easy to follow, accurate, good job!
The only line that is missing is:
sudo apt-get install mysql-server
Warning: Unknown: open_basedir restriction in effect. File(/usr/share/phpmyadmin/index.php) is not within the allowed path(s): (/home/piasek/workspace) in Unknown on line 0
Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Fatal error: Unknown: Failed opening required '/usr/share/phpmyadmin/index.php' (include_path='.') in Unknown on line 0
can u help me?
you need to also run the following command: sudo a2enmod userdir
in order for it to work
THANKS!
1st: When I type in localhost or 127.0.0.1, i get "-bash: localhost: command not found"
When I put my server's ip on the address bar, i get "It works" Is it necessary to correct the "command not found" problem from server?
2nd. Step number 1, how do you create a directory? can you post the command, please?
thanks. :)