Help - Search - Members - Calendar
Full Version: Anybody know how to install mod_layout on cpanel servers?
The Planet Forums > Control Panels > cPanel/WHM
xwing777
Looking for a guide on cpanel servers or whats needed to modify the configuration for it to work. This guide does not work:

CODE
wget http://fresh.t-systems-sfr.com/unix...yout-3.2.tar.gz

tar -zxvf mod_layout-3.2.tar.gz

cd mod_layout-3.2

mv Makefile.STATIC Makefile



It will ask if you want to overwite, press y and enter



pico -w Makefile



Find:

APXS=apxs



Change to:

APXS=/usr/local/apache/bin/apxs



Ctrl + X , y and enter to save the file..



make

make install

service httpd restart


neither does this one:

CODE
1) Download and extract the latest version of mod_layout to a temp directory on your server

(http://software.tangent.org/downloa...yout-3.2.tar.gz)



2) Edit the file /usr/sbin/apxs



Look for the lines...



my $CFG_PREFIX = q(/etc/httpd); # substituted via APACI install

my $CFG_SBINDIR = q(/usr/sbin); # substituted via APACI install

my $CFG_INCLUDEDIR = q(/usr/include/apache); # substituted via APACI install

my $CFG_LIBEXECDIR = q(/usr/lib/apache); # substituted via APACI install

my $CFG_SYSCONFDIR = q(/etc/httpd/conf); # substituted via APACI install



And change them to...



my $CFG_PREFIX = q(/usr/local/apache); # substituted via APACI install

my $CFG_SBINDIR = q(/usr/local/apache/bin); # substituted via APACI install

my $CFG_INCLUDEDIR = q(/usr/local/apache/include); # substituted via APACI install

my $CFG_LIBEXECDIR = q(/usr/local/apache/libexec); # substituted via APACI install

my $CFG_SYSCONFDIR = q(/usr/local/apache/conf); # substituted via APACI install





3) Save apxs and return to your mod_layout install directory.



4) make



5) make install
tekprio
It looks like you do not have the script apxs within your PATH. Try "locate apxs" and see where it is (mine is in /usr/local/apache/bin/apxs). That is the script to install mod_layout for you. It is part of the Apache build and is used to install most of the Apache modules.

It you don't see it anywhere on your server, that means your Apache build is not configured with that script included.
xwing777
yeah same as mine and same as the first guide said to change:

APXS=/usr/local/apache/bin/apxs
tekprio
So, when you say it doesn't work, what is the axact problem? Error messages? Configuration?
xwing777
using guide #1 during make, shows:
liblayout.a
make: liblayout.a: Command not found
make: *** [liblayout.a] Error 127

and gives seg faults when adding something like:

<Virtualhost IP address>
LayoutFooter /footer.html
LayoutHeader /header.html
</virtualhost>

in httpd.conf file.

The other guide doesnt give errors but still won't display anything in the html as it should. The module is listed there though:
LoadModule layout_module libexec/mod_layout.so

AddModule mod_layout.c
tekprio
It seems the Makefile is corrupted. liblayout.a should be the target and not a command. You may need to find another source for the whole tar file. BTW, your copy is old. Try finding a more recent one. I have version 3.2.1 and that might not even the latest one.
xwing777
I have tried versions mod_layout-3.0.1 through mod_layout-4.0.2a from here

Do you have a makefile that works or know what is edited correctly and formatted for a rhe/cpanel install?

Heres the make install using mod_layout-3.2.1 after editing the makefile to relflect correct paths:

CODE
`/usr/local/apache/bin/apxs -q CC` -I`/usr/local/apache/bin/apxs -q INCLUDEDIR` `/usr/local/apache/bin/apxs -q CFLAGS`  -c mod_layout.c -Wall -DDEBUG

`/usr/local/apache/bin/apxs -q CC` -I`/usr/local/apache/bin/apxs -q INCLUDEDIR` `/usr/local/apache/bin/apxs -q CFLAGS`  -c utility.c -Wall -DDEBUG

`/usr/local/apache/bin/apxs -q CC` -I`/usr/local/apache/bin/apxs -q INCLUDEDIR` `/usr/local/apache/bin/apxs -q CFLAGS`  -c origin.c -Wall -DDEBUG

`/usr/local/apache/bin/apxs -q CC` -I`/usr/local/apache/bin/apxs -q INCLUDEDIR` `/usr/local/apache/bin/apxs -q CFLAGS`  -c layout.c -Wall -DDEBUG

/usr/local/apache/bin/apxs -c  mod_layout.o utility.o origin.o layout.o

gcc -shared -o mod_layout.so mod_layout.o utility.o origin.o layout.o

strip mod_layout.so

/usr/local/apache/bin/apxs -i -a -n 'layout' mod_layout.so

[activating module `layout' in /usr/local/apache/conf/httpd.conf]

cp mod_layout.so /usr/local/apache/libexec/mod_layout.so

chmod 755 /usr/local/apache/libexec/mod_layout.so

cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak

cp /usr/local/apache/conf/httpd.conf.new /usr/local/apache/conf/httpd.conf

rm /usr/local/apache/conf/httpd.conf.new


Then when i run httpd configtest:

Trying to insert <body*>
CODE
ADDING LAYOUT:<body*> (1) (2)(1)

Trying to insert <body*>

ADDING LAYOUT:<body*> (1) (2)(2)

/usr/sbin/httpd: line 199:  3386 Segmentation fault      (core dumped) $HTTPD -t
tekprio
How about downloading a fresh version, untar it and try just the command "make"? That will install mod_layout as a DSO module, which is what you probably want. No need to make a static compilation as the first guide did.
xwing777
fresh install no edits gives:
CODE
`apxs -q CC` -I`apxs -q INCLUDEDIR` `apxs -q CFLAGS`   -c mod_layout.c -Wall -DDEBUG

/bin/sh: line 1: apxs: command not found

/bin/sh: line 1: apxs: command not found

/bin/sh: line 1: apxs: command not found

/bin/sh: line 1: -I: command not found

make: *** [mod_layout.o] Error 127


so then i edited the Makefile to reflect correct apxs file:

APXS=/usr/local/apache/bin/apxs

and this gives:

QUOTE
`apxs -q CC` -I`apxs -q INCLUDEDIR` `/usr/local/apache/bin/apxs -q CFLAGS`   -c mod_layout.c -Wall -DDEBUG
/bin/sh: line 1: apxs: command not found
/bin/sh: line 1: apxs: command not found
/bin/sh: line 1: -I: command not found
make: *** [mod_layout.o] Error 127


Whats wrong with this line?
CODE
/bin/sh: line 1: apxs: command not found


This is the top of the makefile:
QUOTE
APXS=/usr/local/apache/bin/apxs
APACHECTL=apachectl
CC=`apxs -q CC`
INC=-I`apxs -q INCLUDEDIR` `$(APXS) -q CFLAGS`  #-DLAYOUT_FILEOWNER_NAME
LD_SHLIB=`apxs -q LDFLAGS_SHLIB`
VERSION = 3.2.1
DISTNAME = mod_layout
DISTVNAME = $(DISTNAME)-$(VERSION)

SRC = mod_layout.c utility.c origin.c layout.c
OBJ = mod_layout.o utility.o origin.o layout.o

SHELL =/bin/sh
PERL = perl
NOOP = $(SHELL) -c true
RM_RF = rm -rf
SUFFIX = .gz
COMPRESS = gzip --best
TAR  = tar
TARFLAGS = cvf
PREOP = @$(NOOP)
POSTOP = @$(NOOP)
TO_UNIX = @$(NOOP)


BTW. Thanks for your help so far as i have spent hours searching the net for any ideas on getting this to work but nothing works yet icon_cry.gif
tekprio
That was your shell complaing it couldn't find the script apxs. You can make a symbolic link

ln -s /usr/local/apache/bin/apxs /usr/local/bin/apxs

to get around the command not found error. Then run "make" again to see how far we get.
xwing777
ok, it didnt give any errors that way on make or make install
but when trying to add header/footer in httpd.config httpd configtest gives:

CODE
Trying to insert <body*>

ADDING LAYOUT:<body*> (1) (2)(1)

Trying to insert <body*>

ADDING LAYOUT:<body*> (1) (2)(2)

/usr/sbin/httpd: line 199: 20079 Segmentation fault      (core dumped) $HTTPD -t
tekprio
Ok. So the mod_layout version you have is definitely incompartible with your version of Apache. Try this version instead and see if it is better:

http://fresh.t-systems-sfr.com/unix/src/ww...yout-3.2.tar.gz

It works for me. All I need to do is "make ; make install".
xwing777
it gave
CODE
make: *** No targets specified and no makefile found.  Stop.


di i need to edit anything first?


EDIT: :shock: never mind forgot to cd to the directory...checking it now
xwing777
Yay! Finally works as it should now. tekprio, i owe you one icon_biggrin.gif
tekprio
It's no problem. I am glad it works for you.
xwing777
The only question now is how to make it automatically be in the <VirtualHost> sections of httpd.config for any sub-domains i add later?

Or basically the entire server wide regardless of using IP,domain,sub-domain current or if any were added later?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.