# Apache 2.4 Problems

**URL:** <https://forums.suse.com/t/apache-2-4-problems/26579>\
**Category:** SLES Configure-Administer\
**Created:** [January 18, 2015, 3:14am UTC](https://forums.suse.com/t/apache-2-4-problems/26579 "2015-01-18T03:14:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![carnold6](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carnold6](https://forums.suse.com/u/carnold6)\
**Post date:** [January 18, 2015, 3:14am UTC](https://forums.suse.com/t/apache-2-4-problems/26579/1 "2015-01-18T03:14:47Z")

</div>

Apache 2.4 on sles 12. I understand this version is way different from 2.2 but I can’t get 2.4 to even listen on 80 or 443. Can anyone help me with this? The logs only shows me when I start and stop Apache. Btw, I am using apache2ctl stop/start as rcapache2 doesn’t seem to stop/start and etc/init.d/apache2 stop/start is not even in that path…

Here is my httpd.conf:

# run under this user/group id

Include /etc/apache2/uid.conf

# - how many server processes to start (server pool regulation)

# - usage of KeepAlive

Include /etc/apache2/server-tuning.conf

ErrorLog /var/log/apache2/error\_log

# generated from APACHE\_MODULES in /etc/sysconfig/apache2

Include /etc/apache2/sysconfig.d/loadmodule.conf

# IP addresses / ports to listen on

Include /etc/apache2/listen.conf

# predefined logging formats

Include /etc/apache2/mod\_log\_config.conf

# generated from global settings in /etc/sysconfig/apache2

Include /etc/apache2/sysconfig.d/global.conf

# optional mod\_status, mod\_info

Include /etc/apache2/mod\_status.conf  
Include /etc/apache2/mod\_info.conf

Include /etc/apache2/mod\_reqtimeout.conf

# optional cookie-based user tracking

# read the documentation before using it!!

Include /etc/apache2/mod\_usertrack.conf

# configuration of server-generated directory listings

Include /etc/apache2/mod\_autoindex-defaults.conf

# associate MIME types with filename extensions

TypesConfig /etc/apache2/mime.types  
Include /etc/apache2/mod\_mime-defaults.conf

# set up (customizable) error responses

Include /etc/apache2/errors.conf

# global (server-wide) SSL configuration, that is not specific to

# any virtual host

Include /etc/apache2/ssl-global.conf

# forbid access to the entire filesystem by default
 Options None AllowOverride None # See /usr/share/doc/packages/apache2/README-access\_compat.txt Order deny,allow Deny from all Require all denied 
# use .htaccess files for overriding,

AccessFileName .htaccess

# and never show them

\<Files ~ “^\.ht”\>  
# See /usr/share/doc/packages/apache2/README-access\_compat.txt  
  
Order allow,deny  
Allow from all  
  
\<IfModule !mod\_access\_compat.c\>  
Require all granted

# List of resources to look for when the client requests a directory

DirectoryIndex index.html index.html.var index.php

Include /etc/apache2/default-server.conf

# Another way to include your own files

# 

# The file below is generated from /etc/sysconfig/apache2,

# include arbitrary files as named in APACHE\_CONF\_INCLUDE\_FILES and

# APACHE\_CONF\_INCLUDE\_DIRS

Include /etc/apache2/sysconfig.d/include.conf

IncludeOptional /etc/apache2/vhosts.d/\*.conf

Here is the listen.conf:

Listen 80

```
         Listen 443

     </IfModule>
 </IfDefine>

```

Here is a vhost conf:

\<VirtualHost \*:80\>  
ServerAdmin [email@domain.tld](mailto:email@domain.tld)  
ServerName domain.tld  
ServerAlias [www.domain.tld](https://www.domain.tld)

```
 DocumentRoot /srv/www/htdocs/sites/domain

 # if not specified, the global error log is used
 ErrorLog /var/log/apache2/teknerds.net-error_log
 CustomLog /var/log/apache2/teknerds.net-access_log combined

 # don't loose time with IP address lookups
 HostnameLookups Off

 # needed for named virtual hosts
 UseCanonicalName Off

 # configures the footer on server-generated documents
 ServerSignature On

 ScriptAlias /cgi-bin/ "/srv/www/vhosts/dummy-host.example.com/cgi-bin/"

 # "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
 # CGI directory exists, if you have one, and where ScriptAlias points to.
 #
 <Directory "/srv/www/vhosts/dummy-host.example.com/cgi-bin">
     AllowOverride None
     Options +ExecCGI -Includes
     <IfModule mod_access_compat.c>
         Order allow,deny
         Allow from all
     </IfModule>
     <IfModule !mod_access_compat.c>
         Require all granted
     </IfModule>
 </Directory>

 #
 # This should be changed to whatever you set DocumentRoot to.
 #
 <Directory "/srv/www/htdocs/sites/domain">

     Options Indexes FollowSymLinks
 
     AllowOverride None
 
     # See /usr/share/doc/packages/apache2/README-access_compat.txt
     <IfModule mod_access_compat.c>
         Order allow,deny
         Allow from all
     </IfModule>
     <IfModule !mod_access_compat.c>
         Require all granted
     </IfModule>

 
 </Directory>

```

The error from chrome is connection rejected. Netstat -nlp does not show listening on 80 or 443. I have a phpinfo.php file on the doc root, a html file on the doc root and a website in the above location; can not get to any of these places

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [January 18, 2015, 3:48am UTC](https://forums.suse.com/t/apache-2-4-problems/26579/2 "2015-01-18T03:48:21Z")

</div>

What do you have in the various log files, particularly the error logs?

ErrorLog /var/log/apache2/teknerds.net-error\_log  
ErrorLog /var/log/apache2/error\_log

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below…

---

<div class="post-metadata">

**Author:** ![carnold6](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carnold6](https://forums.suse.com/u/carnold6)\
**Post date:** [January 18, 2015, 4:01am UTC](https://forums.suse.com/t/apache-2-4-problems/26579/3 "2015-01-18T04:01:44Z")

</div>

[QUOTE=ab;25867]What do you have in the various log files, particularly the error logs?

ErrorLog /var/log/apache2/teknerds.net-error\_log  
ErrorLog /var/log/apache2/error\_log[/QUOTE]

There is absolutely 0 in their in regards to trying make a connection. 0 in the access/error.log; only shows where I stop and start, that’s it.

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [January 18, 2015, 5:32am UTC](https://forums.suse.com/t/apache-2-4-problems/26579/4 "2015-01-18T05:32:08Z")

</div>

I think SLE 12 is using systemd; have you tried the systemd equivalent to  
start the service? I’m guessing it is something like this:

```auto
sudo systemctl start apache2.service
```

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below…

---

<div class="post-metadata">

**Author:** ![carnold6](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carnold6](https://forums.suse.com/u/carnold6)\
**Post date:** [January 19, 2015, 4:45am UTC](https://forums.suse.com/t/apache-2-4-problems/26579/5 "2015-01-19T04:45:20Z")

</div>

[QUOTE=ab;25869]I think SLE 12 is using systemd; have you tried the systemd equivalent to  
start the service? I’m guessing it is something like this:

`
sudo systemctl start apache2.service
`[/QUOTE]

I restarted the server and now i get at least a 403 and netstat shows port 80 but not 443 and php downloads instead of showing page. How do you get 443 running? Any ideas? Modules are loaded. SSL Vhost is present. See above for listen.conf

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [January 19, 2015, 3:47pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/6 "2015-01-19T15:47:48Z")

</div>

On 19/01/2015 02:54, carnold6 wrote:  
[color=blue]

> I restarted the server and now i get at least a 403 and netstat shows  
> port 80 but not 443 and php downloads instead of showing page. How do  
> you get 443 running? Any ideas? Modules are loaded. SSL Vhost is  
> present. See above for listen.conf[/color]

Did you notice those IfDefine directives around the Listen 443 line in  
listen.conf? Those tell Apache to listen on port 443 if the SSL flag is  
set and the NOSSL flag is not set.

Have you added SSL to the APACHE\_SERVER\_FLAGS line (between the quotes)  
in the /etc/sysconfig/apache2 file? If now adding it you’ll then need to  
restart Apache.

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [January 19, 2015, 3:49pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/7 "2015-01-19T15:49:15Z")

</div>

On 18/01/2015 03:32, ab wrote:  
[color=blue]

> I think SLE 12 is using systemd; have you tried the systemd equivalent to  
> start the service? I’m guessing it is something like this:
> 
> `
> sudo systemctl start apache2.service
> `[/color]

The rcapache2 startup script still exists for SLES12 but has been  
rewritten to reflect systemd rather than SysVinit.

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![carnold6](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carnold6](https://forums.suse.com/u/carnold6)\
**Post date:** [January 19, 2015, 11:09pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/8 "2015-01-19T23:09:31Z")

</div>

I finally got the SSL working but now face a mod\_jk SLES 12 specific issue. In /etc/sysconfig/apache, in the apache\_modules list I put jk and apache will not start. I remove jk from that file and apache starts. What is the correct syntax for mod\_jk in the apache\_modules?

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [January 20, 2015, 12:49pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/9 "2015-01-20T12:49:20Z")

</div>

On 19/01/2015 21:14, carnold6 wrote:  
[color=blue]

> I finally got the SSL working but now face a mod\_jk SLES 12 specific  
> issue. In /etc/sysconfig/apache, in the apache\_modules list I put jk and  
> apache will not start. I remove jk from that file and apache starts.  
> What is the correct syntax for mod\_jk in the apache\_modules?[/color]

Presumably when you start Apache with mod\_jk enabled (jk added to  
APACHE\_MODULES) an error is displayed?

When I installed the apache2-mod\_jk package, enabled mod\_jk (“a2enmod  
jk”), then restarted Apache (“rcapache2 start”) I got ‘Job for  
apache2.service failed. See “systemctl status apache2.service” and  
“journalctl -xn” for details.’

Both “systemctl status apache2.service” (or “rcapache2 status”) and  
“journalctl -xn” show “httpd (no pid file) not running” with “tail  
/var/log/apache2/error\_log” revealing more with last two lines:

–begin–  
No JkLogFile defined in httpd.conf. Using default /srv/www/logs/mod\_jk.log  
No such file or directory: mod\_jk: could not open JkLog file  
/srv/www/logs/mod\_jk.log  
—end—

Since the /srv/www/logs/ directory doesn’t exist I’m not surprised it  
failed but rather than create it I think the correct thing to do is add  
a custom .conf file to /etc/apache2/conf.d/ with "JkLogFile  
/var/log/apache2/mod\_jk.log.

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![carnold6](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carnold6](https://forums.suse.com/u/carnold6)\
**Post date:** [January 20, 2015, 5:16pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/10 "2015-01-20T17:16:17Z")

</div>

[QUOTE=smflood;25891]On 19/01/2015 21:14, carnold6 wrote:  
[color=blue]

> I finally got the SSL working but now face a mod\_jk SLES 12 specific  
> issue. In /etc/sysconfig/apache, in the apache\_modules list I put jk and  
> apache will not start. I remove jk from that file and apache starts.  
> What is the correct syntax for mod\_jk in the apache\_modules?[/color]

Presumably when you start Apache with mod\_jk enabled (jk added to  
APACHE\_MODULES) an error is displayed?

When I installed the apache2-mod\_jk package, enabled mod\_jk (“a2enmod  
jk”), then restarted Apache (“rcapache2 start”) I got ‘Job for  
apache2.service failed. See “systemctl status apache2.service” and  
“journalctl -xn” for details.’

Both “systemctl status apache2.service” (or “rcapache2 status”) and  
“journalctl -xn” show “httpd (no pid file) not running” with “tail  
/var/log/apache2/error\_log” revealing more with last two lines:

–begin–  
No JkLogFile defined in httpd.conf. Using default /srv/www/logs/mod\_jk.log  
No such file or directory: mod\_jk: could not open JkLog file  
/srv/www/logs/mod\_jk.log  
—end—

Since the /srv/www/logs/ directory doesn’t exist I’m not surprised it  
failed but rather than create it I think the correct thing to do is add  
a custom .conf file to /etc/apache2/conf.d/ with "JkLogFile  
/var/log/apache2/mod\_jk.log.[/QUOTE]

What i found was the jk module, when unloaded, allowed apache to start. I tried both mod\_jk and jk in the apache modules line. What is suppose to be the correct text to load mod\_jk?

---

<div class="post-metadata">

**Author:** ![rvillafafila](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rvillafafila](https://forums.suse.com/u/rvillafafila)\
**Post date:** [January 20, 2015, 6:12pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/11 "2015-01-20T18:12:20Z")

</div>

> [@carnold6;25899](#):
>
> What i found was the jk module, when unloaded, allowed apache to start. I tried both mod\_jk and jk in the apache modules line. What is suppose to be the correct text to load mod\_jk?

To enable a module in apache don’t edit /etc/sysconfig/apache file because SuSe-config command is not available in SLES 12.  
Use the command `a2enmod jk` and restart/reload apache with the command `systemctl restart/reload apache2`  
All these steps are assuming you have installed apache2-mod\_jk package  
If you find some problems starting apache2 with systemctl command, you can view the errors executing one of the next commands

`systemctl status apache2 -l 
or
journalctl -xn
`

---

<div class="post-metadata">

**Author:** ![carnold6](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carnold6](https://forums.suse.com/u/carnold6)\
**Post date:** [January 20, 2015, 6:25pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/12 "2015-01-20T18:25:18Z")

</div>

[QUOTE=rvillafafila;25903]To enable a module in apache don’t edit /etc/sysconfig/apache file because SuSe-config command is not available in SLES 12.  
Use the command `a2enmod jk` and restart/reload apache with the command `systemctl restart/reload apache2`  
All these steps are assuming you have installed apache2-mod\_jk package[/QUOTE]

I ran a2enmod without any errors but when I use `systemctl restart/reload apache2` I get `start_apache[3548]: httpd (no pid file) not running` and the only way to get apache running again is to remove jk from the /etc/sysconfig/apache file[/quote]

[quote]If you find some problems starting apache2 with systemctl command, you can view the errors executing one of the next commands

`systemctl status apache2 -l 
or
journalctl -xn
`[/QUOTE]

The above error is all that is reported from system status apache2 -l and journalctl -xn

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [January 20, 2015, 6:53pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/13 "2015-01-20T18:53:40Z")

</div>

On 20/01/2015 16:34, carnold6 wrote:  
[color=blue]

> rvillafafila;25903 Wrote:[color=green]
> 
> > To enable a module in apache don’t edit /etc/sysconfig/apache file  
> > because SuSe-config command is not available in SLES 12.  
> > Use the command \>[/color]  
> > Code:  
> > --------------------[color=green][color=darkred]
> > 
> > > a2enmod jk[/color][/color]  
> > > --------------------[color=green][color=darkred]  
> > > and restart/reload apache with the command \>[/color][/color]  
> > > Code:  
> > > --------------------[color=green][color=darkred]  
> > > systemctl restart/reload apache2[/color][/color]  
> > > --------------------[color=green][color=darkred]  
> > > [/color]  
> > > _All these steps are assuming you have installed apache2-mod\_jk  
> > > package_[/color]
> 
> ## I ran a2enmod without any errors but when I use Code:
> 
> ```
> systemctl restart/reload apache2
> 
> ```
> 
> * * *
> 
> ## I get Code:
> 
> ```
> start_apache[3548]: httpd (no pid file) not running
> 
> ```
> 
> * * *
> 
> and the only way to get apache running again is to remove jk from the  
> /etc/sysconfig/apache file
> 
> If you find some problems starting apache2 with systemctl command, you  
> can view the errors executing one of the next commands
> 
> ## Code:
> 
> ```
> systemctl status apache2 -l
> 
> ```
> 
> or  
> journalctl -xn
> 
> * * *
> 
> The above error is all that is reported from system status apache2 -l and  
> journalctl -xn[/color]

(Re)Read my earlier reply where I worked through getting Apache to start  
with mod\_jk enabled. I’m guessing it’s failing because mod\_jk doesn’t  
have a valid directory to write log files to.

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [January 20, 2015, 6:56pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/14 "2015-01-20T18:56:18Z")

</div>

On 20/01/2015 16:14, rvillafafila wrote:  
[color=blue]

> ## To enable a module in apache don’t edit /etc/sysconfig/apache file because SuSe-config command is not available in SLES 12. Use the command Code:
> 
> ```
> a2enmod jk
> 
> ```
> 
> --------------------[/color]

Whilst the “SuSEconfig” command may not exist in SLE12 its files still  
exist in /etc/sysconfig/ so as well as using “a2enmod jk” it’s possible  
to edit /etc/sysconfig/apache2 and add jk to APACHE\_MODULES - it’s what  
the a2enmod command does.

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![rvillafafila](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rvillafafila](https://forums.suse.com/u/rvillafafila)\
**Post date:** [January 20, 2015, 11:25pm UTC](https://forums.suse.com/t/apache-2-4-problems/26579/15 "2015-01-20T23:25:52Z")

</div>

> [@carnold6;25904](#):
>
> I ran a2enmod without any errors but when I use `systemctl restart/reload apache2` I get `start_apache[3548]: httpd (no pid file) not running` and the only way to get apache running again is to remove jk from the /etc/sysconfig/apache file

The above error is all that is reported from system status apache2 -l and journalctl -xn[/QUOTE]

This error is produced because the apache2 service is not started yet.  
Try to start it with this command

```auto
systemctl start apache2
```

Read smflood’s posts because he explains you the same as me
