LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   HTTPD & PHP & MySQL Installation (https://www.linuxquestions.org/questions/linux-software-2/httpd-and-php-and-mysql-installation-4175492270/)

praneethdamera 01-23-2014 04:35 AM

HTTPD & PHP & MySQL Installation
 
hi,

I have installed in my fedora 19 httpd, mysql(mariadb)and it worked nicely but when i have installed php from yum, after that my httpd server is not starting but when i remove this package(php) again i can use my httpd very well what might be the problem

below error im getting when i start httpd after installation.
Redirecting to /bin/systemctl start httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.

lpwevers 01-23-2014 05:14 AM

Hi Praneeth

Can you please also post the output of the suggested commands:
Code:

systemctl status httpd.service
and
Code:

journalctl -xn
Louis

praneethdamera 01-23-2014 06:01 AM

---

praneethdamera 01-23-2014 06:03 AM

systemctl status httpd.service

httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Thu 2014-01-23 17:32:23 IST; 15s ago
Process: 1591 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=1/FAILURE)
Process: 1589 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"

Jan 23 17:32:23 localhost.localdomain httpd[1589]: httpd: Syntax error on line 56 of /etc/httpd/...nce
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exite...URE
Jan 23 17:32:23 localhost.localdomain httpd[1591]: httpd: Syntax error on line 56 of /etc/httpd/...nce
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service: control process exited, code=ex...s=1
Jan 23 17:32:23 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Jan 23 17:32:23 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.




--------------------------------------------------------------------------------------------
journalctl -xn




-- Logs begin at Wed 2007-02-21 20:14:53 IST, end at Thu 2014-01-23 17:32:23 IST. --
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service stopping timed out. Killing.
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service: main process exited, code=killed, sta
Jan 23 17:32:23 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Jan 23 17:32:23 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman.../systemd-devel
--
-- Unit httpd.service has begun starting up.
Jan 23 17:32:23 localhost.localdomain httpd[1589]: httpd: Syntax error on line 56 of /etc/httpd/conf/h
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, sta
Jan 23 17:32:23 localhost.localdomain httpd[1591]: httpd: Syntax error on line 56 of /etc/httpd/conf/h
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited s
Jan 23 17:32:23 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman.../systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Soft...28ba40df7e9d02
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jan 23 17:32:23 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.

lpwevers 01-23-2014 06:34 AM

Well, there you go:
Code:

Jan 23 17:32:23 localhost.localdomain httpd[1589]: httpd: Syntax error on line 56 of /etc/httpd/...nce
In your httpd.conf (most likely /etc/httpd/conf/httpd.conf) there's a syntax error on line 56. Can you please check in there? Post line 56 (and the surrounding ones) if you don't see what's wrong.

Louis

praneethdamera 01-23-2014 07:05 AM

56 line :

Include conf.modules.d/*.conf

-------------

I have tried manual installation also in that when i update this file server stops ..

i used the steps from.

http://www.thegeekstuff.com/2008/07/...urce-on-linux/

lpwevers 01-23-2014 07:38 AM

Well, the line Include conf.modules.d/*.conf should be OK, assuming that conf.modules.d exists. So maybe it's an error from one of the included files. Can you post the error log from your http server? Hopefully it has more details.

Louis

sundialsvcs 01-23-2014 09:32 AM

Hmmm... the answer is staring you in the face. Do you really need to petition "the Internet at-large" to figure this problem out for you? If you're stumped, seek help from one of your colleagues and/or your supervisor. But is it really so hard to make an educated guess as to where the problem might be, and what it might be? Try a little harder . . . You need the practice.

praneethdamera 01-25-2014 04:40 AM

dude im new to linux and not able to figure out what the file system in this is and where i can fingure or where i shouldnot touch thats why im not able to check each and every files in this and waiting searching for solutions.

can u tell me what these folders are meant to ie what data will/&should be there and how it is done etc wheteher i can fingure in that folder or not.


boot etc lib media opt root sbin sys usr www
bin dev home lost+found mnt proc run srv tmp var

and i want to clear you all that im not having any experienced collegue or supervisor as im only single person trying to learn linux and trying to make websites, as im intrested in web designing in it.

presently im working in an enterprise where i use windows mostly and trying to convert to linux me and my college two of us just trying to shift to this platform.

lpwevers 01-25-2014 05:13 AM

Hi,

Well, I asked, for line 56 and the surrounding lines. That may help a lot more. The error can be at another line, but it may just be reported there. And since it's your include for conf.d, just post whatever is in there as well. (That is the contents of the files there)

Louis

Doug G 01-25-2014 09:28 PM

Try using IncludeOptional. In apache 2.4 Include will give an error if there are no matching wildcard files in the given include path.

praneethdamera 01-26-2014 10:13 PM

# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so 'log/access_log'
# with ServerRoot set to '/www' will be interpreted by the
# server as '/www/log/access_log', where as '/log/access_log' will be
# interpreted as '/log/access_log'.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "/etc/httpd"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
Include conf.modules.d/*.conf

#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User apache
Group apache

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin root@localhost

#
# 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 your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ".ht*">
Require all denied
</Files>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "logs/error_log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

#
# 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. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog "logs/access_log" common

#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar

#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

</IfModule>

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>

<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig /etc/mime.types

#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

# For type maps (negotiated resources):
#AddHandler type-map var

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default. To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8

<IfModule mime_magic_module>
#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
MIMEMagicFile conf/magic
</IfModule>

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall may be used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
# Defaults if commented: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
EnableSendfile on

# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf

##################################################


can any one tell me when i search for any installation all say it might me in /etc/.. or /usr/..

etc..

why they are installing in different locations when i use same yum to install a s/w.


SAbhi 01-26-2014 10:29 PM

Quote:

Include conf.modules.d/*.conf
There isn't any error in syntax here but the error could be because the conf files that line is referring too aren't at that location, check again for dir being present.
NOTE: i cant see you followed the link you posted in one of your above comments.

praneethdamera 01-27-2014 09:34 PM

can you tell me how can i check include path for conf whether all files are there or not as it is given * that means all files & here i have

00-base.conf 00-dav.conf 00-lua.conf 00-mpm.conf 00-proxy.conf 00-systemd.conf 01-cgi.conf


files can you tell me if any other files also must be there in this list.

Can any one tell me the installation steps clearly for installing
1. Httpd Server (i hve done it and working nice till php install)
2. PHP
3. MySQL (this is also done but this shows it is maria DB does it make any difference as when i executed my sql file in this it says check the manual, i have cleared that error by rewriting the code in Caps and removing varchar2 to varchar)


and if any web developer is available can you suggest me any PHP API to use for connecting to Excel Sheet (ie to Read Write Append).

SAbhi 01-28-2014 02:07 AM

in that case can you give me the full error shown in logs:

Quote:

Jan 23 17:32:23 localhost.localdomain httpd[1589]: httpd: Syntax error on line 56 of /etc/httpd/conf/h
Jan 23 17:32:23 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, sta
Jan 23 17:32:23 localhost.localdomain httpd[1591]: httpd: Syntax error on line 56 of /etc/httpd/conf/h
that has whats missing in.

EDIT:
with some search i found thi could be because of OS upgrades..and openssl package..
Can you try running

Code:

yum update openssl
and then restart your machine.


All times are GMT -5. The time now is 11:40 AM.