View Full Version : Apache and MySQL


Buickman
03-26-2007, 08:10 PM
Do any of you know of a good site that describes these in layman's terms, as far as how to use them, and with MySQL, what it's for, exactly? All of the guides I read assume I have a doctorate in linux. They just cover installation. If I install apache, how do I post a website to it? I've found nothing that tells me how to do this. I can do it with W2k3 server. That's fairly simple. Believe it or not, I can't even find 'Apache For Dummies' anywhere.

eaux-yeah
03-26-2007, 09:49 PM
First of all, I have never setup Apache on Ubuntu (opening for openbsd plug), but have on just about every other distro. They are generally the same.

Do any of you know of a good site that describes these in layman's terms, as far as how to use themThis is for Dapper, but should be no different than Edgy
http://www.howtoforge.com/node/1388

To help you with your search, look for LAMP, it's more referred to by that.
Linux
Apache
MySQL
PHP

in Ubuntu:
sudo apt-get install lampshould install everything you need.
After you install Apache, start it, and go to http://127.0.0.1/manual, there is an incredible amount of information right there.

and with MySQL, what it's for, exactly?MySQL is just a database. It is not needed for Apache to operate.
MySQL IS needed for most out-of-the-box web applications, for instance what you're looking at now and so many other things. It is actually quite easy to create some nice stuff with MySQL and PHP alone.

If I install apache, how do I post a website to it?
That depends on how it is setup.

Individual users can have their own sites in their home directories. The standard setup is /home/username/public_html which would resolve to http://fqdn.name (http://%3Ci%3Efqdn.name%3C/i%3E)/~username. That is the way most distros and ISP's have it setup. Once the username is created, the default Apache settings allow that same user to upload with already established passwords
Of course, you can serve files from anywhere you like on your system and control each and every directory in some really cool ways.

Hope that answered something.

Buickman
03-27-2007, 03:52 AM
First of all, I have never setup Apache on Ubuntu (opening for openbsd plug), but have on just about every other distro. They are generally the same.

This is for Dapper, but should be no different than Edgy
http://www.howtoforge.com/node/1388

To help you with your search, look for LAMP, it's more referred to by that.
Linux
Apache
MySQL
PHP

in Ubuntu:
sudo apt-get install lampshould install everything you need.
After you install Apache, start it, and go to http://127.0.0.1/manual, there is an incredible amount of information right there.

MySQL is just a database. It is not needed for Apache to operate.
MySQL IS needed for most out-of-the-box web applications, for instance what you're looking at now and so many other things. It is actually quite easy to create some nice stuff with MySQL and PHP alone.


That depends on how it is setup.

Individual users can have their own sites in their home directories. The standard setup is /home/username/public_html which would resolve to http://fqdn.name (http://%3Ci%3Efqdn.name%3C/i%3E)/~username. That is the way most distros and ISP's have it setup. Once the username is created, the default Apache settings allow that same user to upload with already established passwords
Of course, you can serve files from anywhere you like on your system and control each and every directory in some really cool ways.

Hope that answered something.

You actually answered more than those sites I've already visited. None of them even mentioned http://127.0.0.1/manual. What you said about the standard setup makes a lot of sense now.

What I did was established a dynamic dns so I could try and build a website on my home system. Just something to play with.

Buickman
03-30-2007, 04:24 PM
I've got it figured out. I have to post it into /var/www instead. I think that's an ubuntu thing. With that being said, what's a good web design program for linux? I installed a couple (Nvu and Bluefish), but is there any that's comparable to Front Page or Dreamweaver, as far as doing the fancy stuff?

eaux-yeah
03-31-2007, 11:44 AM
I have to post it into /var/www instead. I think that's an ubuntu thing. /var/www is the Apache main server directory. You can setup individual user directories pretty easy.

Open the /etc/apache2/apache2.conf
Go about 200 or so lines down until you get to the 'UserDir' section.

Uncomment (remove #'s) the following:

#UserDir public_html

#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options Indexes SymLinksIfOwnerMatch IncludesNoExec
#</Directory>
Now create the public_html in your home directory logged in as your normal user (NOT root):
mkdir ~/public_htmlDrop an index.html file in that direcory, restart Apache and you should be able to see something by going to http://ip_address (http://%3Ci%3Eip_address%3C/i%3E)/~your_username

What's a good web design program for linux? I installed a couple (Nvu and Bluefish), but is there any that's comparable to Front Page or Dreamweaver, as far as doing the fancy stuff?AFAIK, NVU is probably as close as your going to get to Dreamweaver. I do know that Dreamweaver 8 and MX both run fine in WINE.
http://frankscorner.org/index.php?p=webdesign
Don't know about FrontPage, I don't touch that ........... too many cooties.

BlueFish is not bad. It's a lot like HomeSite. Another similar to BlueFish/HomeSite is SCREEM. (http://www.screem.org)
Quanta Plus (http://quanta.kdewebdev.org) is . It's a KDE application, so a few KDE libraries and pieces will be installed along with it.

All of the above IS in the Ubuntu repository.
I do not do a lot of web design anymore and that's about all I have used personally.

I know that there are literally hundreds of web editors for Linux. You can go to FreshMeat (http://freshmeat.net/) and type 'web editor', 'wysiwyg', or whatever in the Search field. You'll find something you like, I'm sure.

eaux-yeah
04-11-2007, 07:57 PM
FYI, there is much more to Apache than 'meets the eye'.

I'll start off with 2 very nice, very powerful Apache Modules.

1)
If your going to hang your Apache web server on the public net, install and learn all about ModSecurity (http://www.modsecurity.org). It should be in just about any repository of your distro of choice.
With the exception of a well configured firewall, one of the best methods for protecting Apache, IMO. This is even more highly recommended if running Apache on Micro$oft systems.

2)
Mod_Rewrite (http://httpd.apache.org/docs/2.0/misc/rewriteguide.html) is another.
You can perform ANY type of URL manipulation. You're limited only by your imagination.

Here's an example on my server (Apache Version 1):
If you have a public Apache server, you will no doubt have many many attacks (or attempted attacks) in your logs aimed at IIS servers. (vti_bin, cmd.exe, root.exe, etc)
I just add a few mod_rewrite rules to send all of the IIS attacks/probes to where they should go, Micro$oft! It's their mess, let them deal with it. :smilielol:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RedirectMatch permanent (.*)cmd.exe(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)root.exe(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/_vti_bin\/(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/scripts\/\.\.(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/_mem_bin\/(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/msadc\/(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/MSADC\/(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/c\/winnt\/(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/d\/winnt\/(.*)$ http://www.microsoft.com
RedirectMatch permanent (.*)\/x90\/(.*)$ http://www.microsoft.com
</IfModule>Yoink!

llama
04-15-2007, 07:50 PM
I'm so using those rewrites! Awesome.

Quanta can connect via ssh with sftp if I remember correctly--very handy. I'm an Emacs user myself.