Jump to content

Cant figure out Apache

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
13 replies to this topic

#1
jayrare

jayrare

    Newbie

  • Members
  • Pip
  • 8 posts
Not sure which forum this should go.... please move it to wherever it belongs.

Alright, a few years back I had access to some server space that had allowed me to learn the basics of PHP/MySQL. I decided I want to relearn them, problem is I can't figure out Apache. No guides I read really make much sense. I downloaded Rapache as I had seen it in the Ubuntu repository and with that I was able to reach a point where I get the "It Works!" screen, but now I'm confused again. Can somebody explain to me how now to set up php and MySQL and also how do I get pages running (I had added a file called index.php to the folder created with Rapache, and though I knew it wouldnt work right with no php, ht.tp://localhost/index.php says it doesnt even exist, so I'm confused at how you view)

One of my major problems is the guides for linux software always like to show you how to customise it. Well, I'd rather not customise something I don't even understand. Rather just have a basic default setup that will allow me to practise writing php scripts on my laptop.

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
I don't use Ubuntu but I think all you need is apt-get:

$ apt-get install apache2 php5 libapache2-mod-php5

That gives you php5 and apache2. Then:

$ apt-get install mysql-server mysql-client php5-mysql

I took this from here: http://www.howtoforg...ian_lamp_server

#3
jayrare

jayrare

    Newbie

  • Members
  • Pip
  • 8 posts
Okay, php installed fine (I think) and mysql is currently downloading. If I'm understanding this correctly I'd go to /var/www/page to view a page?


EDIT: Okay, still not getting it. Tried opening /var/www/index.php and it brought up the firefox dialog asking me if I want to save or open the file. Not sure what I'm doing wrong.

Edited by jayrare, 19 March 2009 - 12:38 PM.


#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
In your browser you need to go to: http://localhost/index.php OR http://127.0.0.1/index.php

#5
XStatik

XStatik

    Newbie

  • Members
  • PipPip
  • 26 posts
I have apache2, php5, and the mysql setup, running off a dyndns hosting service but I cant seem to find in the apache2.conf file where i set up the host address and information thats needed for the webserver to link up to the service

#6
alilg

alilg

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

XStatik said:

I have apache2, php5, and the mysql setup, running off a dyndns hosting service but I cant seem to find in the apache2.conf file where i set up the host address and information thats needed for the webserver to link up to the service
it must be here i thinks
/etc/httpd/httpd.conf


#7
XStatik

XStatik

    Newbie

  • Members
  • PipPip
  • 26 posts
Well there is nothing in the /etc/httpd/httpd.conf file so if you could give me a start as what to add here that would be awesome. Somewhere i need to declare the domain name/server name, and I was thinking it was in the /etc/apache2/apache2.conf but im not sure.

#8
alilg

alilg

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts
run this command at your linux terminal or your server ssh
find / -name "httpd.conf"


#9
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
In Ubuntu all your apache configuration files are in /etc/apache2/

I think httpd.conf just includes apache2.conf - which then includes all the configuration files in /etc/apache2/mods-enabled/ and /etc/apache2/sites-enabled.

#10
XStatik

XStatik

    Newbie

  • Members
  • PipPip
  • 26 posts
I know where the config files are located, i just am not sure what to actually put in the files. Last time i did it i remember it was just a few simple lines

#11
alilg

alilg

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts

XStatik said:

I know where the config files are located, i just am not sure what to actually put in the files. Last time i did it i remember it was just a few simple lines
something like
<VirtualHost 1.0.0.0.0.1:80> //IP
	ServerName   domain.com:80
	ServerAlias  www.domain.com
	UseCanonicalName Off
	ServerAdmin  "email@mailservice.com"
	DocumentRoot /var/www/domain.com/httpdocs
</VirtualHost>

But, by adding these simple lines to your apache file, your website domain will not works!. you need to build DNS stuff for each one of your domains!

#12
XStatik

XStatik

    Newbie

  • Members
  • PipPip
  • 26 posts
Before, i never thought i declared it as a virtual host. I thought i just put in the apache2.conf something like ServerName my.servername.com

Does there have to be a virtual host declared?