LSWS installed but serves Apache test page instead of my site

Discussion in 'Install/Configuration' started by Psalmist, Dec 14, 2013.

  1. Psalmist

    Psalmist New Member

    Installed LSWS on a dedicated server running Centos 6.3 with Plesk 11.

    Set port offset to 2000. Can reach [mydomain]:7080 no problem but [mydomain]:2080 shows an Apache test page (instead of my site), and the following error gets logged (in the LSWS web console log):

    owner of file does not match owner of vhost, path [/var/www/vhosts/[mydomain]/httpdocs/index.php], access denied.

    The owner of the file index.php is apache.

    Is there a simple fix for that?
    Last edited: Dec 14, 2013
  2. Psalmist

    Psalmist New Member

    P.S. Also for what it's worth, I have not yet rebuilt php to use all the same config parameters that it is using under apache (there are a lot and the docs say to remove some that are apache-specific or whatever and I don't know how to determine which ones should be removed). But I'm assuming that the error message above isn't because of php configuration, but just in case I'm mentioning that also.

    P.S. Again: oddly, I can't log into Horde webmail for my domain now since installing LSWS, even though LSWS is running on another port -- don't know if that's just a coincidence. I get the login page but it just basically refreshes when I try to log in.
    Last edited: Dec 14, 2013
  3. NiteWave

    NiteWave Administrator

    lsws webadmin:)7080)
    Server->General->Using Apache Configuration File
    what's your current settings
  4. Psalmist

    Psalmist New Member

    Using Apache Configuration File
    Load Apache Configuration Yes
    Auto Reload On Changes use Apache binary wrapper
    Apache Binary Path /usr/sbin/httpd
    Apache Configuration File /etc/httpd/conf/httpd.conf
    Apache Port Offset 2000
    Apache IP Offset 0
    Apache Handled Content Not Set
    Ignore Apache Modules mod_php5,sapi_apache2,python,fcgid
    Just In Time Configuration Not Set
    PHP suEXEC No
    PHP suEXEC Max Conn 10
    Enable FrontPage Extension Not Set
    Apache Environment Not Set



    Apache Style Configurations
    Apache Style configurations Not Set
  5. Psalmist

    Psalmist New Member

    And regarding the original error message "owner of file does not match owner of vhost, path [/var/www/vhosts/[mydomain]/httpdocs/index.php], access denied.", how can I find out the "owner of vhost"?
  6. Psalmist

    Psalmist New Member

    Okay perhaps the problem is simply permissions? Again the error message says the owner of the file index.php does not match the owner of vhost. So here are some details regarding file ownership and related info.


    LSWS is running under owner apache

    the file:

    /var/www/vhosts/[mydomain]/httpdocs/index.php owner apache, group apache

    now peel back for vhost related permissions:

    /var/www/vhosts/[mydomain]/httpdocs owner root, group apache

    /var/www/vhosts/[mydomain] owner root, group root



    And if this matters, there are a few *.include files under /var/www/vhosts/[mydomain]/conf with owner root, group apache.


    Also if it matters, there is no .htaccess file in my /var/www/vhosts/[mydomain]/httpdocs directory.
  7. NiteWave

    NiteWave Administrator

    not sure what's happened exactly
    but can you check
    lsws webadmin->Server->Security->Force Strict Ownership
    if it's Yes, try to set it to No
  8. Psalmist

    Psalmist New Member

    Nitewave: yes it was set to force strict ownership, so I set that to no, and now there's progress! Though still not there yet.

    Well now LSWS is serving my static html pages, whereas before it wouldn't serve any of my pages. But it still won't serve the main index.php or any php pages. Now instead of the apache test page I get nothing (when I go to mydomain:2080).

    So maybe now the issue is php configuration? I was advised to rebuild php under LSWS with the same config options presently used with apache. I haven't done that yet simply because there are a lot of config options and I'm supposed to omit the ones that are apache specific or whatever and I don't really know how to distinguish.

    But at least there's progress. And I just now compared first byte time for a static html page: LSWS: .216s, Apache: .293s. Almost 0.1s difference, which is significant!
  9. NiteWave

    NiteWave Administrator

    you may need rebuild lsphp5 many times to get familiar with it.

    you can start build it with just one options -- for example, --with-mysql=mysqlnd(if it's php 5.3.x), then build out your first lsphp5.
    you can set the 1st target: have youdomain:2080/phpinfo.php working.
  10. NiteWave

    NiteWave Administrator

    any progress ?

    build php is graphical UI through Webadmin->Actions->Compile PHP, it's actually very easy once you get familiar with it.
  11. Psalmist

    Psalmist New Member

    Thanks for following up. I haven't rebuilt PHP yet but for sure that's the problem. I looked in the php error_log file and found this:

    Call to undefined function mysqli_init()
  12. Psalmist

    Psalmist New Member

    Here are all the config options on my php running under apache (as shown under "configure command" in the phpinfo() output):

    './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--without-sqlite3' '--disable-phar' '--disable-fileinfo' '--disable-json' '--without-pspell' '--disable-wddx' '--without-curl' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem'

    Should I just use the same options for the rebuild of PHP under LSWS? Also the configure command for the default LSWS PHP has more options than my PHP under Apache. Should I simply replace it all with the above, or merge the two???

    ALSO...... under additional ini files parsed, in my current PHP under apache, it says:

    /etc/php.d/00-ioncube-loader.ini, /etc/php.d/axcache.ini, /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/json.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/sqlite3.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zend_extensions_psa.ini, /etc/php.d/zip.ini

    I suppose I should make sure those are includes as well, when I rebuild PHP under LSWS? And how do I do include those?

    Also I see there are other included ini files under the default LSWS PHP. Should I include those as well, in my rebuild?

    I'm sorry that it's not so straightforward to me.
  13. NiteWave

    NiteWave Administrator

    >And how do I do include those?
    keep this option '--with-config-file-scan-dir=/etc/php.d'

    while I have no much experience on plesk, I'd suggest
    1)delete some path related options, like
    --bindir=/usr/bin, --infodir=/usr/share/info, etc,
    but replace --prefix=/usr with --prefix=/usr/local/lsws/lsphp5
    2)it looks only this option
    --with-apxs2=/usr/sbin/apxs
    is specific to apache. replace it with --with-litespeed
    all other options are common
    3)build minimum php, it'll improve the php performance.
    for shared hosting, since it may hosts any kind of php scripts, so a huge php binary which include almost all php module is necessary. for your server which dedicate a vBulletin forum, minimum php is better.

    here's my suggestion to start up your php build:
    './configure' '--prefix=/usr/local/lsws/lsphp5' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--with-freetype-dir' '--with-png-dir' '--with-xpm-dir' '--enable-gd-native-ttf' '--with-jpeg-dir' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-gd' --with-litespeed

    when there are error messages which show missed php functions, can add needed options and rebuild lsphp again.

    this wiki http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:lsapi:troubleshoot
    should be very helpful when build lsphp.
  14. Psalmist

    Psalmist New Member

    Nitewave thanks for all your help.

    I tried to rebuilt PHP from the web console with the config options you suggested, and here is the result:

    **MAIN_STATUS** retrieved from /usr/local/lsws/phpbuild/buildphp_1387260628.5.progress
    Start building PHP 5.3.27 with LSAPI
    Configuring PHP build (2-3 minutes)
    **ERROR** Could not configure PHP build
  15. Psalmist

    Psalmist New Member

    and the detailed log:

    **LOG_DETAIL** retrieved from /usr/local/lsws/phpbuild/buildphp_1387260628.5.log

    ==============================================
    Start building PHP 5.3.27 with LSAPI
    ==============================================
    Tue Dec 17 01:13:11 EST 2013

    Changing to build directory /usr/local/lsws/phpbuild/php-5.3.27
    Configuring PHP build (2-3 minutes)
    ./configure '--prefix=/usr/local/lsws/lsphp5' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--with-freetype-dir' '--with-png-dir' '--with-xpm-dir' '--enable-gd-native-ttf' '--with-jpeg-dir' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-gd' '--with-litespeed'
    creating cache ./config.cache
    checking for Cygwin environment... no
    checking for mingw32 environment... no
    checking for egrep... grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for gcc... gcc
    checking whether the C compiler (gcc ) works... yes
    checking whether the C compiler (gcc ) is a cross-compiler... no
    checking whether we are using GNU C... yes
    checking whether gcc accepts -g... yes
    checking how to run the C preprocessor... gcc -E
    checking for icc... no
    checking for suncc... no
    checking whether gcc and cc understand -c and -o together... yes
    checking how to run the C preprocessor... gcc -E
    checking for AIX... no
    checking whether ln -s works... yes
    checking for system library directory... lib64
    checking whether to enable runpaths... yes
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking for gawk... gawk
    checking for bison... bison -y
    checking for bison version... 2.4.1 (ok)
    checking for re2c... no
    configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking whether to enable computed goto gcc extension with re2c... no
    checking whether to force non-PIC code in shared modules... no
    checking whether /dev/urandom exists... yes
    checking for pthreads_cflags... -pthread
    checking for pthreads_lib...

    Configuring SAPI modules
    checking for AOLserver support... no
    checking for Apache 1.x module support via DSO through APXS... no
    checking for Apache 1.x module support... no
    checking whether to enable Apache charset compatibility option... no
    checking for Apache 2.0 filter-module support via DSO through APXS... no
    checking for Apache 2.0 handler-module support via DSO through APXS... no
    checking for Apache 1.x (hooks) module support via DSO through APXS... no
    checking for Apache 1.x (hooks) module support... no
    checking whether to enable Apache charset compatibility option... no
    checking for Caudium support... no
    checking for CLI build... yes
    checking for Continuity support... no
    checking for embedded SAPI library support... no
    checking for FPM build... no
    checking for Zeus ISAPI support... no
    checking for LiteSpeed support... yes
    checking for Milter support... no
    checking for NSAPI support... no
    checking for PHTTPD support... no
    checking for Pi3Web support... no
    checking whether Roxen module is build using ZTS... no
    checking for Roxen/Pike support...
    checking for thttpd... no
    checking for TUX... no
    checking for webjames... no
    checking for chosen SAPI module... litespeed

    Running system checks
    checking for sendmail... /usr/sbin/sendmail
    checking whether system uses EBCDIC... no
    checking whether byte ordering is bigendian... no
    checking whether writing to stdout works... This is the test message -- yes
    checking for socket... yes
    checking for socketpair... yes
    checking for htonl... yes
    checking for gethostname... yes
    checking for gethostbyaddr... yes
    checking for yp_get_default_domain... no
    checking for __yp_get_default_domain... no
    checking for yp_get_default_domain in -lnsl... yes
    checking for dlopen... no
    checking for __dlopen... no
    checking for dlopen in -ldl... yes
    checking for sin in -lm... yes
    checking for inet_aton... yes
    checking for ANSI C header files... yes
    checking for dirent.h that defines DIR... yes
    checking for opendir in -ldir... no
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for dirent.h... yes
    checking for ApplicationServices/ApplicationServices.h... no
    checking for sys/param.h... yes
    checking for sys/types.h... yes
    checking for sys/time.h... yes
    checking for netinet/in.h... yes
    checking for alloca.h... yes
    checking for arpa/inet.h... yes
    checking for arpa/nameser.h... yes
    checking for assert.h... yes
  16. Psalmist

    Psalmist New Member

    checking for crypt.h... yes
    checking for dns.h... no
    checking for fcntl.h... yes
    checking for grp.h... yes
    checking for ieeefp.h... no
    checking for langinfo.h... yes
    checking for limits.h... yes
    checking for locale.h... yes
    checking for monetary.h... yes
    checking for netdb.h... yes
    checking for pwd.h... yes
    checking for resolv.h... yes
    checking for signal.h... yes
    checking for stdarg.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for syslog.h... yes
    checking for sysexits.h... yes
    checking for sys/ioctl.h... yes
    checking for sys/file.h... yes
    checking for sys/mman.h... yes
    checking for sys/mount.h... yes
    checking for sys/poll.h... yes
    checking for sys/resource.h... yes
    checking for sys/select.h... yes
    checking for sys/socket.h... yes
    checking for sys/stat.h... yes
    checking for sys/statfs.h... yes
    checking for sys/statvfs.h... yes
    checking for sys/vfs.h... yes
    checking for sys/sysexits.h... no
    checking for sys/varargs.h... no
    checking for sys/wait.h... yes
    checking for sys/loadavg.h... no
    checking for termios.h... yes
    checking for unistd.h... yes
    checking for unix.h... no
    checking for utime.h... yes
    checking for sys/utsname.h... yes
    checking for sys/ipc.h... yes
    checking for dlfcn.h... yes
    checking for assert.h... (cached) yes
    checking for fopencookie... yes
    checking for broken getcwd... no
    checking for broken libc stdio... yes
    checking whether struct tm is in sys/time.h or time.h... time.h
    checking for tm_zone in struct tm... yes
    checking for missing declarations of reentrant functions... done
    checking for fclose declaration... ok
    checking for tm_gmtoff in struct tm... yes
    checking for struct flock... yes
    checking for socklen_t... yes
    checking size of size_t... 8
    checking size of long long... 8
    checking size of long long int... 8
    checking size of long... 8
    checking size of int... 4
    checking size of intmax_t... 8
    checking size of ssize_t... 8
    checking size of ptrdiff_t... 8
    checking for st_blksize in struct stat... yes
    checking for st_blocks in struct stat... yes
    checking for st_rdev in struct stat... yes
    checking for size_t... yes
    checking for uid_t in sys/types.h... yes
    checking for struct sockaddr_storage... yes
    checking for field sa_len in struct sockaddr... no
    checking for IPv6 support... yes
    checking for vprintf... yes
    checking for alphasort... yes
    checking for asctime_r... yes
    checking for chroot... yes
    checking for ctime_r... yes
    checking for cuserid... yes
    checking for crypt... no
    checking for flock... yes
    checking for ftok... yes
    checking for funopen... no
    checking for gai_strerror... yes
    checking for gcvt... yes
    checking for getloadavg... yes
    checking for getlogin... yes
    checking for getprotobyname... yes
    checking for getprotobynumber... yes
    checking for getservbyname... yes
    checking for getservbyport... yes
    checking for gethostname... (cached) yes
    checking for getrusage... yes
    checking for gettimeofday... yes
    checking for gmtime_r... yes
    checking for getpwnam_r... yes
    checking for getgrnam_r... yes
    checking for getpwuid_r... yes
    checking for grantpt... yes
    checking for inet_ntoa... yes
    checking for inet_ntop... yes
    checking for inet_pton... yes
    checking for isascii... yes
    checking for link... yes
    checking for localtime_r... yes
    checking for lockf... yes
    checking for lchown... yes
    checking for lrand48... yes
    checking for memcpy... yes
    checking for memmove... yes
    checking for mkstemp... yes
    checking for mmap... yes
    checking for nl_langinfo... yes
    checking for perror... yes
    checking for poll... yes
    checking for ptsname... yes
    checking for putenv... yes
    checking for realpath... yes
    checking for random... yes
    checking for rand_r... yes
    checking for scandir... yes
    checking for setitimer... yes
    checking for setlocale... yes
    checking for localeconv... yes
    checking for setenv... yes
    checking for setpgid... yes
    checking for setsockopt... yes
    checking for setvbuf... yes
    checking for shutdown... yes
    checking for sin... yes
    checking for snprintf... yes
    checking for srand48... yes
    checking for srandom... yes
    checking for statfs... yes
    checking for statvfs... yes
    checking for std_syslog... no
    checking for strcasecmp... yes
    checking for strcoll... yes
    checking for strdup... yes
    checking for strerror... yes
    checking for strftime... yes
    checking for strnlen... yes
    checking for strptime... yes
    checking for strstr... yes
    checking for strtok_r... yes
    checking for symlink... yes
    checking for tempnam... yes
    checking for tzset... yes
    checking for unlockpt... yes
    checking for unsetenv... yes
    checking for usleep... yes
    checking for utime... yes
    checking for vsnprintf... yes
    checking for vasprintf... yes
    checking for asprintf... yes
    checking for nanosleep... yes
    checking for nanosleep in -lrt... yes
    checking for getaddrinfo... yes
    checking for __sync_fetch_and_add... yes
    checking for strlcat... no
    checking for strlcpy... no
    checking for getopt... yes
    checking whether utime accepts a null argument... yes
    checking for working alloca.h... (cached) yes
    checking for alloca... yes
    checking for declared timezone... yes
    checking for type of reentrant time-related functions... POSIX
    checking for readdir_r... yes
    checking for type of readdir_r... POSIX
    checking for in_addr_t... yes
    checking for crypt_r... no

    General settings
    checking whether to include gcov symbols... no
    checking whether to include debugging symbols... no
    checking layout of installed files... PHP
    checking path to configuration file... /etc
    checking where to scan for configuration files... /etc/php.d
    checking whether to enable safe mode by default... no
    checking for safe mode exec dir... /usr/local/php/bin
    checking whether to enable PHP's own SIGCHLD handler... no
    checking whether to enable magic quotes by default... no
    checking whether to explicitly link against libgcc... no
    checking whether to enable short tags by default... yes
    checking whether to enable dmalloc... no
    checking whether to enable IPv6 support... yes
    checking how big to make fd sets... using system default

    Configuring extensions
    checking size of long... (cached) 8
    checking size of int... (cached) 4
    checking for int32_t... yes
    checking for uint32_t... yes
    checking for sys/types.h... (cached) yes
    checking for inttypes.h... (cached) yes
    checking for stdint.h... (cached) yes
    checking for string.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for strtoll... yes
    checking for atoll... yes
    checking for strftime... (cached) yes
    checking which regex library to use... php
    checking whether to enable LIBXML support... yes
    checking libxml2 install dir... no
    checking for xml2-config path...
    configure: error: xml2-config not found. Please check your libxml2 installation.
    **ERROR** Could not configure PHP build
    Copyright © 2002-2013. LiteSpeed Technologies, Inc.
  17. Psalmist

    Psalmist New Member

    By the way, is it intentional that you changed --with-freetype-dir=/usr (in my original apache php config) to --with-freetype-dir (no value set)? Also you changed --with-png-dir=/usr to --with-png-dir (again no value set)?
  18. NiteWave

    NiteWave Administrator

    >configure: error: xml2-config not found. Please check your libxml2 installation.
    please refer
    http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:lsapi:troubleshoot
    search libxml2

    #yum install libxml2-devel
    will fix this error

    yes, I used to build lsphp in this way. while I've not dig into it what's the exact difference.
  19. Psalmist

    Psalmist New Member

    Thanks Nitewave, but shouldn't it be:

    yum install libxml2-devel.x86_64

    Aren't all OS's 64-bit now? I assume mine is. I got this output from the command uname -a :

    Linux [mydomain] 2.6.32-279.14.1.el6.x86_64


    Please confirm. Thanks!
  20. NiteWave

    NiteWave Administrator

    looks it's automatic

    #yum search libxml2-devel
    ...
    libxml2-devel.i686 : Libraries, includes, etc. to develop XML and HTML applications
    libxml2-devel.x86_64 : Libraries, includes, etc. to develop XML and HTML applications
    ...

    actually no libxml2-devel
    but on 64 bit platform, when
    #yum install libxml2-devel
    it selects libxml2-devel.x86_64 automatically

    if want to install 32 bit library, need specify .i686 explicitly
    #yum install libxml2-devel.i686

Share This Page