[BUG] Can't create new vhost since V1.4.10

#1
Hi. I wanted to create a new virtual host today. I did not create one since 1.4.8 (I think). and here what I got.

I click on Virtualhost
I click on Add

I put the vhost name, location, and the usual file name for config : $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf

I click save. It tell me that the config file don't exist and I have the link to create it. All of that is Normal

BUT:

- I click on the "CLICK HERE TO CREATE" link.
* I get a "Input error detected. Please resolve the error(s)." on top of the virtualhost table
* Firebug tell me : "
ReferenceError: lst_createFile is not defined

lst_createFile('configFile') "

It look like a Javascript error.

Note that I did try with the current installed version first, 1.4.10 and I did update to 1.4.11 thinking that it might be resolved but I get the same error.
 

lsfoo

Administrator
#2
Hi Destroyfx,

Thank you for reporting this. We can confirm that this bug exists and are looking into resolving the issue.

In the meantime, if you are familiar with the command line, you can just create a new directory called $VH_NAME in the specified location and copy a vhconf.conf from another virtual host to this one.

Once you restart after copying it over, creating the file will no longer be necessary.

Once again, thank you for reporting this, I will get back to you as soon as I can when it gets fixed.

Hope this helps,
Kevin
 
#3
Hi.

I have the same problem and I tried to debug it, creating directories manually does not solve this because the error is inside the function checking files.

/usr/local/lsws/admin/html.open/classes/CValidation.php

protected function chk_file1($attr, &$path, &$err) {
...
return $this->test_file($path, $err, $attr);
}

$path is equal to '$VH_ROOT/conf/vhconf.xml'

test_file function returns error, file '$VH_ROOT/conf/vhconf.xml' does not exits.

Any information when this gets patched or how we can quick patch itself?
 

lsfoo

Administrator
#4
Hi Cascada,

Thank you for the extra information, I will get an update to you as soon as I can, but be assured that it is being looked at.

If you are able to edit the server configurations, you can just add a new virtual host after the Example(or another) virtual host and it should work (sample at the bottom)

If you already created a new directory and copied the vhconf.conf from another virtual host, you just need to save the server conf and restart the server.

I just tested this myself and it should work, you will just need to reconfigure everything to be correct afterwards.

Let me know if this doesn't work, I'm always happy to help.
Kevin

Sample:

Code:
virtualhost Example {
  vhRoot                  $SERVER_ROOT/Example/
  configFile              $SERVER_ROOT/conf/vhosts/Example/vhconf.conf
  allowSymbolLink         1
  enableScript            1
  restrained              0
  setUIDMode              0
}

virtualhost Newvhost {
  vhRoot                  $SERVER_ROOT/Newvhost/
  configFile              $SERVER_ROOT/conf/vhosts/Newvhost/vhconf.conf
  allowSymbolLink         1
  enableScript            1
  restrained              0
  setUIDMode              0
}
 
#5
I got it to work a while ago from the file from another vhost.

The issue I got was that If I change options, it would revert back without saying any error. To prevent that you also need to check the copied files permission and be sure that the folder with the vhost.conf file have write permission for the openlitespeed.
 

lsfoo

Administrator
#6
Hi Destroyfx, cascada,

@Destroyfx, Nice to hear that you were able to resolve the issues, hope you haven't run into any new ones!

That said, to update you guys, this problem is actually an old issue. We patched it by v1.4.8, but for some reason the next version, and all subsequent versions lost the change during the update. There will likely be a new version released tomorrow(hopefully. Looking at another bug or two that were found) that will bring the fix back.

Cheers,
Kevin
 
Last edited:
#7
Are no developers on this forum? Anyhow, it seems the javascript function 'lst_createFile' does not exist in the file dist/admin/html.open/res/js/lst-app.min.js. Thus the browser cannot execute the function which is under the link.
The function is available in 1.4.8 and looks as follows:
Code:
function lst_createFile(a) {
  $("#confform").prepend('<input type="hidden" name="file_create" value="' + a + '">');
  lst_conf("s")
}
When this function is added to the file functionality is restored.
 
Last edited:

lsfoo

Administrator
#8
Hi raldnor,

Thanks for posting this fix! Yes, editing the file should work as well.

To update everyone, I haven't forgotten to check in on this issue. As it stands, I am still hoping the new version will come out soon, so I'll let everyone know of any updates.

That said, if anyone else runs into this issue, and don't feel comfortable with creating new directories/editing configuration files, please do look at raldnor's quick fix!

Cheers,
Kevin
 
Top