Apache2 start problems

Hallo
Yesterday I installed LAMP on my computer (opensuse13.1 /64bit / KDE) using the comand:
Su
yast2 --install patterns-openSUSE-lamp_server

It seemed to function and the index.html test site was shown properly in the browser/localhost. Then I had problems bringing the php to work, I don´t remember what exactly I´v done/experimented…anyway, apache2 don´t start anymore:

   

systemctl start apache2.service
 Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
 


and:

   
systemctl status apache2.service
 apache2.service - The Apache Webserver
    Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled)
    Active: failed (Result: exit-code) since Di 2014-10-21 10:26:20 CEST; 23min ago
  Main PID: 11166 (code=exited, status=1/FAILURE)
    CGroup: /system.slice/apache2.service
                                                                                                                                                                              
 Okt 21 10:26:20 linux-lv88.site start_apache2[11166]: AH00526: Syntax error on line 48 of /etc/apache2/ssl-global.conf:                                                      
 Okt 21 10:26:20 linux-lv88.site start_apache2[11166]: SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropria..._shmcb?).
 Okt 21 10:26:20 linux-lv88.site systemd[1]: apache2.service: main process exited, code=exited, status=1/FAILURE                                                              
 Okt 21 10:26:20 linux-lv88.site start_apache2[11184]: AH00526: Syntax error on line 48 of /etc/apache2/ssl-global.conf:                                                      
 Okt 21 10:26:20 linux-lv88.site start_apache2[11184]: SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropria..._shmcb?).
 Okt 21 10:26:20 linux-lv88.site systemd[1]: apache2.service: control process exited, code=exited status=1
 Okt 21 10:26:20 linux-lv88.site systemd[1]: Failed to start The Apache Webserver.
 Okt 21 10:26:20 linux-lv88.site systemd[1]: Unit apache2.service entered failed state.

 Hint: Some lines were ellipsized, use -l to show in full.


Can someone help me out of it?

Please post /etc/sysconfig/apache2.
Your error messages indicate that you enabled SSL, but just doing that without other necessary steps won’t work.
So disable it again (variable “APACHE_SERVER_FLAGS” in that file, or run “sudo a2enflag -d SSL”).

For enabling PHP5 support you have to add “php5” to the variable “APACHE_MODULES” or run:

sudo a2enmod php5

Thanks for the fast answer.
here the results:

/etc/sysconfig/apache2
bash: /etc/sysconfig/apache2: Datei oder Verzeichnis nicht gefunden (file or folder not found)


I hope I didn´t make to much mess here with my experiments.
Another detail: the problem started after the first computer reboot: apache2 started but I had no internet connection (no browser/thundurbird/ftp connections) so I changed in the network settings(Yast2) from “user controlled with NetworkManager” to “Traditional Method with ifup”. I addmit that I don´t really understand it but it worked, so have back internet connection but no apache2 anymore, even if I change it back to “user controlled with Networkmanager”.

and:

sudo a2enflag -d SSL
sysconf_addword: file /etc/sysconfig/apache2 is not a readable file


First, you tried to execute the file. I asked for the content.
Second, it appears you don’t have that file at all.

I hope I didn´t make to much mess here with my experiments.

What experiments?
Apparently you deleted /etc/sysconfig/apache2, which is bad enough.
Did you also randomly change config files in /etc/apache2/? I hope not.

The easiest way to get back /etc/sysconfig/apache2 is to reinstall the apache2 package:

sudo zypper in -f apache2

If you did change the configuration files it’s probably better to just delete the whole directory /etc/apache2 before you re-install apache2. A default configuration will then be created from scratch. But in this case you should also re-install apache2-mod_php5, apache2-mod_perl, and aopache2-doc to regenerate their config as well.

Another detail: the problem started after the first computer reboot: apache2 started but I had no internet connection (no browser/thundurbird/ftp connections) so I changed in the network settings(Yast2) from “user controlled with NetworkManager” to “Traditional Method with ifup”. I addmit that I don´t really understand it but it worked, so have back internet connection but no apache2 anymore, even if I change it back to “user controlled with Networkmanager”.

Of course not.
You broke your Apache, that’s unrelated to the way you connect to the internet.
Btw, a user connection with Network Manager only gets established when the user logs in, that’s far too late for Apache obviously, which is normally started during boot already.
If you want to run a web server, you should use ifup, or setup a system connection in NetworkManager.

If you switch to ifup, you have to setup your network connection in YaST as well. You probably didn’t, that’s why you had no connection afterwards. This is especially true for a wireless connection, a wired one should actually work without configuring anything most of the time.

After reinstalling apache2 here the /etc/sysconfig/apache2:

## Path:    Network/WWW/Apache2
## Description:    Configuration for Apache 2

## Type:    string
## Default:    ""
## ServiceRestart: apache2
#
# Here you can name files, separated by spaces, that should be Include'd from 
# httpd.conf. 
#
# This allows you to add e.g. VirtualHost statements without touching 
# /etc/apache2/httpd.conf itself, which makes upgrading easier. 
#
APACHE_CONF_INCLUDE_FILES=""

## Type:    string
## Default:    ""
## ServiceRestart: apache2
#
# Here you can name directories, separated by spaces, that should be Include'd 
# from httpd.conf. 
#
# All files contained in these directories will be recursively included by apache.
# If a pattern like *.conf is appended, apache will use it.
#
# Examples: "/etc/apache2/my_conf/"
#           "/etc/apache2/virtual_hosts/*.conf"
#           "local/*.conf /srv/www/virtual/"
#
APACHE_CONF_INCLUDE_DIRS=""

## Type:    string
## Default:    "actions alias auth_basic authz_host authn_file authz_groupfile authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir"
## ServiceRestart: apache2
#
# [It might look silly to not simply edit httpd.conf for the LoadModule statements.
# However, since the LoadModule statements might need an absolute path to the modules,
# switching between MPMs can be quite a hassle. It's easier to just give the names here.]
#
# * list of all modules shipped with the base distribution: 
#
#    actions alias allowmethods asis auth_basic auth_digest auth_form
#    authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache
#    authnz_ldap authz_core authz_dbd authz_dbm authz_groupfile authz_host
#    authz_owner authz_user autoindex bucketeer buffer cache cache_disk
#    cache_socache case_filter case_filter_in cgi charset_lite data
#    dav dav_fs dav_lock dbd deflate dialup dir dumpio echo env expires
#    ext_filter file_cache filter headers heartmonitor imagemap include
#    info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic
#    lbmethod_heartbeat ldap log_config log_debug log_forensic logio lua macro
#    mime mime_magic negotiation optional_fn_export optional_fn_import
#    optional_hook_export optional_hook_import proxy proxy_ajp
#    proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass
#    proxy_ftp proxy_html proxy_http proxy_scgi proxy_wstunnel ratelimit
#    reflector remoteip reqtimeout request rewrite sed session session_cookie
#    session_crypto session_dbd setenvif slotmem_plain slotmem_shm socache_dbm
#    socache_memcache socache_shmcb speling ssl status substitute suexec
#    unique_id userdir usertrack version vhost_alias watchdog xml2enc 
#
#   see http://httpd.apache.org/docs-2.2/mod/ !
#
# * It pays to use IfDefine statements... like
#    <IfModule mod_xyz.c>
#        ....
#    </IfModule>
#
# * In the APACHE_MODULES variable, you can use mod_xyz or just xyz syntax.
#   You may also name an absolute path if you like.
#
# * NOTE ON SSL: before you can use mod_ssl, you need a server certificate. 
#   A test certificate can be created by entering 
#   'cd /usr/share/doc/packages/apache2; ./certificate.sh' as root.
#   Also, you need to set the ServerName inside the <VirtualHost _default_:443> 
#   block to the fully qualified domain name (see /etc/HOSTNAME).
# * if your server certificate is protected by a passphrase you should increase the
#   APACHE_START_TIMEOUT (see above)
# * to finally enable ssl support, you need to add 'SSL' to APACHE_SERVER_FLAGS 
#   below.
#
# * modules listed here will be ignored if they are not installed
#
#
# EXAMPLES:
#
# fairly minimal
# APACHE_MODULES="authz_host alias auth dir log_config mime setenvif"
#
# apache's default installation
# APACHE_MODULES="authz_host actions alias asis auth autoindex cgi dir imap include log_config mime negotiation setenvif status userdir"
# your settings
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir reqtimeout authn_core authz_core"


## Type:    string
## Default:    ""
## ServiceRestart: apache2
#
# Additional server flags:
#
# Put here any server flags ("Defines") that you want to hand over to 
# httpd at start time, or other command line flags.
#
# Background: Any directives within an <IfDefine flag>...</IfDefine>
#             section are only processed if the flag is defined.
#             This allows to write configuration which is active only in a
#             special cases, like during server maintenance, or for testing
#             something temporarily.
#
# Notably, to enable ssl support, 'SSL' needs to be added here.
# To enable the server-status, 'STATUS' needs to be added here.
#
# It does not matter if you write flag1, -D flag1 or -Dflag1.
# Multiple flags can be given as "-D flag1 -D flag2" or simply "flag1 flag2".
#
# Specifying such flags here is equivalent to giving them on the commandline.
# (e.g. via rcapache2 start -DReverseProxy)
#
# Example:
#      "SSL STATUS AWSTATS SVN_VIEWCVS no_subversion_today"
#
APACHE_SERVER_FLAGS=""

## Type:    string
## Default:    ""
## ServiceRestart: apache2
#
# Which config file do you want to use?
# (if not set, /etc/apache2/httpd.conf is used.)
# It is unusual to need to use this setting.
#
# Note about ulimits:
#   if you want to set ulimits, e.g. to increase the max number of open file handle, 
#   or to allow core files, you can do so by editing /etc/sysconfig/apache2 and
#   simply write the ulimit commands into that file.
#   Example:
#     ulimit -n 16384
#     ulimit -H -n 16384
#     ulimit -c unlimited
#   See the output of "help ulimit" in the bash, or "man 1 ulimit".
#
APACHE_HTTPD_CONF=""

## Type:    list(prefork,worker,event,itk)
## Default:    ""
## ServiceRestart: apache2
#
# MPM (multi-processing module) to use.
#
# Needed to determine with which MPM apache will run, as well as
# against which header files modules will be built. 
#
# If not set, the system will simply pick one of the installed MPMs.
#
# The implementation of the logic is in /usr/share/apache2/find_mpm,
# a script which can be used standalone as well if needed.
#
APACHE_MPM=""

## Type:    string
## Default:    ""
## ServiceReload: apache2
#
# email address of the server administrator (ServerAdmin directive)
# This address is added to the server's responses if APACHE_SERVERSIGNATURE 
# is set to "email". 
#
# If empty ("") it defaults to webmaster@$FQHOSTNAME, where FQHOSTNAME is
# taken from /etc/HOSTNAME. 
#
# Note that ServerAdmin directives inside VirtualHost statements are not
# changed, even not the one in the stock SSL virtual host block. 
#
APACHE_SERVERADMIN=""

## Type:    string
## Default:    ""
## ServiceReload: apache2
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make 
# redirections work in a sensible way.
#
APACHE_SERVERNAME=""

## Type:    integer
## Default:    2
#
# timeout during server startup (seconds)
# after this time, the start script decides wether the httpd process started without error.
#
# Increase it, if you use mod_ssl and your certificate is passphrase protected!
#
APACHE_START_TIMEOUT="2"

## Type:    list(on,off,email)
## Default:    "on"
## ServiceReload: apache2
#
# Configures the footer on server-generated documents 
# This correlates to the ServerSignature directive. 
#
APACHE_SERVERSIGNATURE="on"

## Type:    list(debug,info,notice,warn,error,crit,alert,emerg)
## Default:    "warn"
## ServiceReload: apache2
#
# LogLevel: Control the number of messages logged to the error_log.
#
APACHE_LOGLEVEL="warn"

## Type:    string
## Default:    "/var/log/apache2/access_log combined"
## ServiceRestart: apache2
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrarywise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
# Simply set it to empty, if you configure it yourself somewhere else.
# 
# Examples:
#
# If you would like to have agent and referer logfiles:
#
# setting it to "/var/log/apache2/referer_log referer, /var/log/apache2/agent_log agent"
#   corresponds to 
# CustomLog /var/log/apache2/referer_log referer
# CustomLog /var/log/apache2/agent_log   agent
#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format):
#
# setting it to "/var/log/apache2/access_log combined"
#   corresponds to 
# CustomLog /var/log/apache2/access_log combined
#
APACHE_ACCESS_LOG="/var/log/apache2/access_log combined"

## Type:    list(On,Off,DNS)
## Default:    "Off"
## ServiceReload: apache2
#
# UseCanonicalName: Determines how Apache constructs self-referencing 
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client.  When set "On", Apache will use the value of the
# ServerName directive.
#
APACHE_USE_CANONICAL_NAME="off"

## Type:    list(Major,Minor,Minimal,ProductOnly,OS,Full)
## Default:    "OS"
## ServiceReload: apache2
#
# How much information the server response header field contains about the server.
# (installed modules, versions, etc.)
# see http://httpd.apache.org/docs-2.2/mod/core.html#servertokens
#
APACHE_SERVERTOKENS="OS"

## Type:    list(on,off)
## Default:    "off"
## ServiceReload: apache2
#
# If mod_status is used, include extended information about the server, like 
# CPU usage, in the status report. It is a server-wide setting, and it can cost
# some performance!
#
APACHE_EXTENDED_STATUS="off"


The only conf. file I changed ( following an installation tutorial for apache2) was: /etc/sysconfig/SuSEfirewall2 adding:
FW_CONFIGURATIONS_EXT=“apache2”

Ok, that’s the default one now of course.
Run “sudo a2enmod php5” to enable PHP.

The only conf. file I changed ( following an installation tutorial for apache2) was: /etc/sysconfig/SuSEfirewall2 adding:
FW_CONFIGURATIONS_EXT=“apache2”

Good.
Btw, you can use YaST->Security and Users->Firewall as well to change the firewall configuration.

Now it functions and apache2 is starting! thanks a lot!