Forums

Weavind
Weavind
Offline
Resolved
0 votes
I'm having issues setting up virtual websites on my server (ClearOS 7). When I create the virtual hosts, it comes up with the message, "Ooops!
Update failed - unable to validate new configuration - check logs for more information.". Looking at the logs, it looks like the error is to do with the Flexshare. Snippet below.

Mar 16 08:06:14 localhost flexshare: Invalid httpd configuration!
Mar 16 08:06:14 localhost flexshare: sudo: no tty present and no askpass program specified
Mar 16 08:06:14 localhost engine: exception: error: /usr/clearos/apps/flexshare/libraries/Flexshare.php (3126): Update failed - unable to validate new configuration - check logs for more information.
Mar 16 08:06:14 localhost engine: exception: debug backtrace: /usr/clearos/apps/flexshare/libraries/Flexshare.php (1715): _generate_web_flexshares
Mar 16 08:06:14 localhost engine: exception: debug backtrace: /usr/clearos/apps/flexshare/controllers/share.php (231): update_share
Mar 16 08:06:14 localhost engine: exception: debug backtrace: /usr/clearos/apps/flexshare/controllers/share.php (84): _form


The funny thing is that it does actually create the flexshare directory and the flexshare works 100%. It too worked for creating the virtual website flexshare. The problem came in when no matter which website domain I tried to access, it always directed to the default website. My fix around this was copying configuration from my ClearOS V6 backups. This again worked but the ClearOS moaned that I was using outdated http configuration. This was all fine, until now I want to add SSL to the virtual websites. So assuming there was an error on my installation, I installed ClearOS 7 (fresh downloaded copy) onto a completely separate computer and it is giving the exact same error messages/logs.

So basically, i'm asking what is the correct http configuration to have virtual websites and allocate SSL to them?
Thursday, March 16 2017, 12:34 PM

Location [ View Larger Map ]

http://maps.googleapis.com/maps/api/staticmap?center=-33.9248685,18.424055299999964&language=en&maptype=roadmap&zoom=5&size=450x300&sensor=true&markers=color:red|label:S|-33.9248685,18.424055299999964
Share this post:
Responses (11)
  • Accepted Answer

    Friday, June 02 2017, 11:33 AM - #Permalink
    Resolved
    0 votes
    You can set the immutable bit on the file ("chattr +i file_name") which will stop the OS from changing it, but you'll need to remember it has been set!
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Friday, June 02 2017, 11:08 AM - #Permalink
    Resolved
    0 votes
    Is there any permanent fix to using SSL on the clearOS7 system? I have SSL on multiple virtual sites running on ClearOS7, but it's a pain as each time there is an update, the flex-80.conf file is autocreated and I have to manually remove the section below from the file. Is there specific folder permissions i need to apply or something?

    <Directory /var/www/virtual/websitename.com>
    Options +Indexes +FollowSymLinks -IncludesNOExec
    AllowOverride All
    Require all granted
    </Directory>
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Wednesday, March 22 2017, 02:40 PM - #Permalink
    Resolved
    0 votes
    I found out that the <Directory....</Directory> in the flex-80.conf file is what is breaking the system. No matter what options you select in the webconfig, this just stops the pointing. I have deleted this and my site is working and the SSL is working too. It's just a pain that this is an autocreated file so I have no idea how long it's going to work for.

    <Directory /var/www/html>
    Options +Indexes -FollowSymLinks -IncludesNOExec
    AllowOverride All
    Require all granted
    </Directory>
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Wednesday, March 22 2017, 11:39 AM - #Permalink
    Resolved
    0 votes
    Little checking since my last post. The httpd service failed due to SSL certificate (Unable to configure RSA server private key). If I don't use SSL, then the httpd server starts up. However it does not direct to virtual sites. I see that webconfig has now created a file /etc/http/conf.d/flex-80.conf as well as flex-443.conf files. However they don't seem to have any affect. If I copy my old virtual.website.com.conf file into the /etc/httpd/conf.d directory then the directing to the virtual website works again. However I'm back at square one where I can't use the SSL.
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Wednesday, March 22 2017, 11:13 AM - #Permalink
    Resolved
    0 votes
    Hi,

    Manually did the update. I no longer get the error message in webconfig. I however cannot start the httpd service.

    Mar 22 13:05:18 server systemd: Started ProFTPD FTP Server.
    Mar 22 13:05:21 server webconfig: Redirecting to /bin/systemctl start httpd.service
    Mar 22 13:05:21 server systemd: Starting The Apache HTTP Server...
    Mar 22 13:05:21 server systemd: httpd.service: main process exited, code=exited, status=1/FAILURE
    Mar 22 13:05:21 server kill: kill: cannot find process ""
    Mar 22 13:05:21 server systemd: httpd.service: control process exited, code=exited status=1
    Mar 22 13:05:21 server systemd: Failed to start The Apache HTTP Server.
    Mar 22 13:05:21 server systemd: Unit httpd.service entered failed state.
    Mar 22 13:05:21 server systemd: httpd.service failed.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 22 2017, 10:14 AM - #Permalink
    Resolved
    0 votes
    The update was moved yesterday from clearos-updates-testing to clearos-updates.

    You may already have it.

    B
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Wednesday, March 22 2017, 06:42 AM - #Permalink
    Resolved
    0 votes
    Tried the yum upgrade, but get the message "No packages marked for update".
    The reply is currently minimized Show
  • Accepted Answer

    Friday, March 17 2017, 02:55 PM - #Permalink
    Resolved
    0 votes
    Try this:

    yum --enablerepo=clearos-updates-testing upgrade app-flexshare


    B
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Friday, March 17 2017, 09:08 AM - #Permalink
    Resolved
    0 votes
    HI,

    I was looking through the code and all I can see is that Flexshare.php is not creating the virtual.sitename.conf file in the /etc/httpd/conf.d directory. This causes it to fail the httpd configuration check. If I manually create this file, then the virtual host works fine (with exception of SSL). However if change anything on the webconfig, then the file is deleted and then needs to be manually done again. I've noticed that it also doesn't create the proftpd conf file or amend the flexshare.conf file.

    I've checked permissions and that all looks fine. It must also be noted that I can create regular flexshare folders.
    The reply is currently minimized Show
  • Accepted Answer

    Weavind
    Weavind
    Offline
    Thursday, March 16 2017, 01:52 PM - #Permalink
    Resolved
    0 votes
    Hi,

    Tried the above and the log after trying to change the virtual website:

    Mar 16 15:35:13 intermetafrica installer: app-flexshare-core - adding sudoers entry /usr/sbin/httpd
    Mar 16 15:36:07 intermetafrica flexshare: Invalid httpd configuration!
    Mar 16 15:36:07 intermetafrica flexshare: AH00526: Syntax error on line 22 of /etc/httpd/conf.d/flex-443.conf:
    Mar 16 15:36:07 intermetafrica flexshare: SSLCertificateKeyFile: file '/etc/pki/CA/private/sys-0-key.pem' does not exist or is empty
    Mar 16 15:36:07 intermetafrica engine: exception: error: /usr/clearos/apps/flexshare/libraries/Flexshare.php (3126): Update failed - unable to validate new configuration - check logs for more information.
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/apps/flexshare/libraries/Flexshare.php (945): _generate_web_flexshares
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/apps/web_server/libraries/Httpd.php (652): set_web_enabled
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/apps/web_server/libraries/Httpd.php (421): _set_core_info
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/apps/web_server/controllers/sites.php (382): set_site
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/apps/web_server/controllers/sites.php (140): _item
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: GUI (0): edit
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/framework/system/core/CodeIgniter.php (359): call_user_func_array
    Mar 16 15:36:07 intermetafrica engine: exception: debug backtrace: /usr/clearos/framework/htdocs/app/index.php (222): require_once
    Mar 16 15:36:13 intermetafrica clearsync: web_server - event triggered - configuration_change_event
    Mar 16 15:36:13 intermetafrica clearsync: web_server - reloading httpd



    I checked and neither my live server nor the testing one i created today has the file /etc/httpd/conf.d/flex-443.conf. This is a new line to the error log.
    I copied the sys-0-key.pem file from the /var/clearos directory to /etc/pki/CA/private/, but this made no difference.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, March 16 2017, 01:11 PM - #Permalink
    Resolved
    0 votes
    Run:

    /usr/sbin/addsudo /usr/sbin/httpd app-flexshare-core


    and make sure your server has the latest clearos-base package.

    rpm -qv clearos-base
    clearos-base-7.0.1-1.v7.x86_64


    B
    The reply is currently minimized Show
Your Reply