# Apache and php_mod

## Azerix

i folowd al instruction in HOWTO of thi topic https://forums.gentoo.org/viewtopic.php?t=268285&start=25

but i have a probleem, i kan´t start my apache, when i reboot i get this message 

 *Quote:*   

> 
> 
> *ERROR: "/etc/init.d/apache2" has syntax errors in it; not executing.... 
> 
> 

 

And when i want to start manualy

apache2 -k start, i have no probleem.

But when i want to stop i get this message

 *Quote:*   

> 
> 
> httpd (no pid file) not running 
> 
> 

 

kan any one help  me?

----------

## Azerix

i went to "/etc/init.d/ directory and i type apche2 i get this mesage

 *Quote:*   

> 
> 
> Syntaxt error oline 22 of /etc/apache2/conf/apache2.conf:
> 
> Cannot load /usr/modules/load_acces.so into server: /usr/modules/mod_access.so:
> ...

 

 In my apache2.conf file i add it this text , just like it says in HOWTO https://forums.gentoo.org/viewtopic.php?t=104806&postdays=0&postorder=asc&start=0

LoadModule php4_module      extramodules/libphp4.so

----------

## Azerix

anyone?help plz.  :Crying or Very sad: 

----------

## fleed

1) Remove the line you added to apache.conf

2) edit /etc/conf.d/apache2 so that you have 

APACHE2_OPTS="-D PHP4"

3) Restart apahce by /etc/init.d/apache2 restart

You might want to reemerge apache so that the config files are back to their unscrewed up states. Run etc-update afterwards.

----------

## Azerix

But how do i remove it. i want to remove apache and. Kan any one explain me how to do that?

----------

## nobspangle

to remove just do

```
emerge unmerge apache
```

but you will have to manually remove the config files they won't get removed.

----------

## Azerix

wich config files r those? and where kan i find theme? I  uninstald apache just like you sait, "emerge unmerge apache2" but when i reboot i get error

 *Quote:*   

> 
> 
> Apache has detected a syntax error in your configuration files:
> 
> /sbin/rc line 44: /usr/sbin apache2:No such a file or directory
> ...

 

 :Confused:   :Question: 

I chekt the rc file, but i dont know what to do...what do i have to remove

----------

## Azerix

I installd apache2 and mod_php again , i folfowd this HOWTO

https://forums.gentoo.org/viewtopic.php?t=104806&postdays=0&postorder=asc&highlight=webserver&start=0

But now i get the folowing error

 *Quote:*   

> 
> 
> (2) No such file or directory: apache2: could not open error log file /usr/lib/apache2/logs/error_log.
> 
> Unable to open                                   [!!]
> ...

 

----------

## skyfolly

 *Azerix wrote:*   

> I installd apache2 and mod_php again , i folfowd this HOWTO
> 
> https://forums.gentoo.org/viewtopic.php?t=104806&postdays=0&postorder=asc&highlight=webserver&start=0
> 
> But now i get the folowing error
> ...

 

make sure the logs folder of apache2 existed in /var/log/apache2 folder.

----------

## Azerix

Oke this what i did

 *Quote:*   

> 
> 
> mkdir /var/log/apache2 && chown apache /var/log/apache2
> 
> 

 

But when i reboot , i get this

 *Quote:*   

> 
> 
> Strating apache [!!]
> 
> 

 

And when i try manuali

apache2 -k start, i get no errors or somethink like that.

I try localhost to test apache, i get nothink, page could not found.  :Sad: 

----------

## skyfolly

you forgot that logs folder, create it as well.

----------

## Azerix

 *skyfolly wrote:*   

> you forgot that logs folder, create it as well.

 

How, wich code?what do i have to type?

----------

## Azerix

Is there any one who kan help me?  :Confused: 

----------

## goofus

i think he ment to make a 'logs'  folder in var/log/apache2.  :Question: 

----------

## skyfolly

 *goofus wrote:*   

> i think he ment to make a 'logs'  folder in var/log/apache2. 

 

yeah/

mkdir /var/log/apache2/logs

----------

## Azerix

I stil have the same probleem  :Confused:  Not starting.

 *Quote:*   

> 
> 
> Starting apache2......[!!]
> 
> 

 

[/quote]

----------

## skyfolly

it is better to post your full apache2 and commonapache2 confs here for people to see if there were problems in your configurations.

also make sure the /var/log/apache2/logs folder is writable by apache2 as well. you are using apache 2.0, not 1.0, right?

when you reinstall, make sure you remove all apache2 related folders before continuing, USE="apache2" when emerge.

----------

## fleed

Also give us exactly what steps you're taking, all the commands you do. Eg:

emerge -C apache 

emerge apache

/etc/init.d/apache start

etc. 

Some tips: Starting apache manually is NO GOOD (generally you won't be passing the same params that the startup script passes). You don't need to reboot the machine after installing apache (/etc/init.d/apache start will accomplish the same). 

Post your full configs.

To get php and apache working you should not need to edit much, only /etc/conf.d/apache. 

Clean all the mess you've done and do EXACTLY this:

```

emerge apache mod_php

echo APACHE_OPTS="-D PHP4" >> /etc/conf.d/apache2

/etc/init.d/apache2 start

```

And please report any errors, including those in logs.

----------

## Azerix

 *skyfolly wrote:*   

> it is better to post your full apache2 and commonapache2 confs here for people to see if there were problems in your configurations.
> 
> also make sure the /var/log/apache2/logs folder is writable by apache2 as well. you are using apache 2.0, not 1.0, right?
> 
> when you reinstall, make sure you remove all apache2 related folders before continuing, USE="apache2" when emerge.

 

i folowd this HOWTO:  https://forums.gentoo.org/viewtopic.php?t=104806&postdays=0&postorder=asc&highlight=webserver&start=0

First i try this code to make log folder

 *Quote:*   

> 
> 
> mkdir /var/log/apache2 && chown apache /var/log/apache2
> 
> 

 

And then i did wat skyfully sait to make logs folder

 *Quote:*   

> 
> 
> mkdir /var/log/apache2/logs
> 
> 

 

but i fet the foflowing message, he kant make logs folder.

 *Quote:*   

> 
> 
> mkdir:cannot create directory ´/var/log/apache2/logs´: File exists
> 
> 

 

I went to that directory /var/log/apache2/logs, and i have 3 files in.

acces_log, error_log,  logs

I kant post apache2 conf and apachecommon conf file, couse i work in tekst mode, i have no KDE, i work with out GUI, i kan not make screenshuts, i will try to make a foto with a webcame.   :Smile: 

----------

## Azerix

oke, if i uninstal apache, wich config files do i have to delet manuali after uninstal, that was my quistion in the begining? Kan any one  tell me? wich files do i have to delet, after uninstaling apache.

----------

## skyfolly

first you

```
emerge unmerge apache2
```

second

```
delete all apache2 related folders
```

perhaps you have to do the same for mysql and php as well.

third, reinstalling all the packages.

```
USE="apache2 mysql mod_php" emerge apache2 mysql mod_php
```

remember to delete the files in the /var/log/apache2/logs folder as well. cause it would create a new logs again.

----------

## nobspangle

maybe you should look in the error log to see why apache isn't starting.

----------

