mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 23:36:11 +01:00
merge docker volume code changes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
|
containerization
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ INSTALLED_APPS = [
|
|||||||
'cloudAPI',
|
'cloudAPI',
|
||||||
'highAvailability',
|
'highAvailability',
|
||||||
's3Backups',
|
's3Backups',
|
||||||
'dockerManager'
|
'dockerManager',
|
||||||
|
'containerization'
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ urlpatterns = [
|
|||||||
url(r'^emailMarketing/', include('emailMarketing.urls')),
|
url(r'^emailMarketing/', include('emailMarketing.urls')),
|
||||||
url(r'^cloudAPI/', include('cloudAPI.urls')),
|
url(r'^cloudAPI/', include('cloudAPI.urls')),
|
||||||
url(r'^docker/', include('dockerManager.urls')),
|
url(r'^docker/', include('dockerManager.urls')),
|
||||||
|
url(r'^container/', include('containerization.urls')),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -570,7 +570,7 @@ def changeAdminPassword(request):
|
|||||||
firstName="Cyber", lastName="Panel", acl=acl, token=token)
|
firstName="Cyber", lastName="Panel", acl=acl, token=token)
|
||||||
admin.save()
|
admin.save()
|
||||||
|
|
||||||
vers = version(currentVersion="1.7", build=7)
|
vers = version(currentVersion="1.8", build=0)
|
||||||
vers.save()
|
vers.save()
|
||||||
|
|
||||||
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/custom-js/pnotify.custom.min.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/custom-js/pnotify.custom.min.css' %}">
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'websiteFunctions/websiteFunctions.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'websiteFunctions/websiteFunctions.css' %}">
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://www.jsdelivr.com/package/npm/fontawesome">
|
||||||
<!-- Components theme, component below was above three CSS files. -->
|
<!-- Components theme, component below was above three CSS files. -->
|
||||||
|
|
||||||
|
|
||||||
@@ -115,6 +116,8 @@
|
|||||||
}, 300);
|
}, 300);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/flot-charts@0.8.3/jquery.flot.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/jquery.flot@0.8.3/jquery.flot.time.js"></script>
|
||||||
|
|
||||||
<!-- JS Ends -->
|
<!-- JS Ends -->
|
||||||
|
|
||||||
@@ -608,6 +611,24 @@
|
|||||||
|
|
||||||
<li class="header serverACL"><span>{% trans "Server" %}</span></li>
|
<li class="header serverACL"><span>{% trans "Server" %}</span></li>
|
||||||
|
|
||||||
|
|
||||||
|
<li class="serverACL">
|
||||||
|
<a href="#" title="{% trans 'Containerization' %}">
|
||||||
|
<i class="glyph-icon icon-linecons-fire"></i>
|
||||||
|
<span>{% trans "Containerization" %}</span>
|
||||||
|
<span class="bs-label badge-yellow">{% trans "NEW" %}</span>
|
||||||
|
</a>
|
||||||
|
<div class="sidebar-submenu">
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="{% url 'cHome' %}"
|
||||||
|
title="{% trans 'Create Website Limits' %}"><span>{% trans "Create Limits" %}</span></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div><!-- .sidebar-submenu -->
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="serverACL">
|
<li class="serverACL">
|
||||||
<a href="#" title="{% trans 'Docker' %}">
|
<a href="#" title="{% trans 'Docker' %}">
|
||||||
<i class="glyph-icon icon-linecons-fire"></i>
|
<i class="glyph-icon icon-linecons-fire"></i>
|
||||||
@@ -886,6 +907,7 @@
|
|||||||
<script src="{% static 'manageSSL/manageSSL.js' %}"></script>
|
<script src="{% static 'manageSSL/manageSSL.js' %}"></script>
|
||||||
<script src="{% static 'manageServices/manageServices.js' %}"></script>
|
<script src="{% static 'manageServices/manageServices.js' %}"></script>
|
||||||
<script src="{% static 'dockerManager/dockerManager.js' %}"></script>
|
<script src="{% static 'dockerManager/dockerManager.js' %}"></script>
|
||||||
|
<script src="{% static 'containerization/containerization.js' %}"></script>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -11,7 +11,6 @@ urlpatterns = [
|
|||||||
#url(r'^upgrade',views.upgrade, name='upgrade'),
|
#url(r'^upgrade',views.upgrade, name='upgrade'),
|
||||||
|
|
||||||
url(r'^UpgradeStatus',views.upgradeStatus, name='UpgradeStatus'),
|
url(r'^UpgradeStatus',views.upgradeStatus, name='UpgradeStatus'),
|
||||||
|
|
||||||
url(r'^upgradeVersion',views.upgradeVersion, name='upgradeVersion'),
|
url(r'^upgradeVersion',views.upgradeVersion, name='upgradeVersion'),
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
|||||||
from cloudManager import CloudManager
|
from cloudManager import CloudManager
|
||||||
import json
|
import json
|
||||||
from loginSystem.models import Administrator
|
from loginSystem.models import Administrator
|
||||||
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
|
|
||||||
def router(request):
|
def router(request):
|
||||||
try:
|
try:
|
||||||
@@ -13,6 +14,7 @@ def router(request):
|
|||||||
serverUserName = data['serverUserName']
|
serverUserName = data['serverUserName']
|
||||||
admin = Administrator.objects.get(userName=serverUserName)
|
admin = Administrator.objects.get(userName=serverUserName)
|
||||||
|
|
||||||
|
|
||||||
cm = CloudManager(data, admin)
|
cm = CloudManager(data, admin)
|
||||||
|
|
||||||
if controller == 'statusFunc':
|
if controller == 'statusFunc':
|
||||||
|
|||||||
1120
dockerManager/container.py
Normal file
1120
dockerManager/container.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ import docker
|
|||||||
import json
|
import json
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
|
|
||||||
def preDockerRun(function):
|
def preDockerRun(function):
|
||||||
def wrap(request, *args, **kwargs):
|
def wrap(request, *args, **kwargs):
|
||||||
@@ -36,7 +37,8 @@ def preDockerRun(function):
|
|||||||
try:
|
try:
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
client.ping()
|
client.ping()
|
||||||
except:
|
except BaseException, msg:
|
||||||
|
logging.writeToFile(str(msg))
|
||||||
if isPost:
|
if isPost:
|
||||||
data_ret = {'status': 0, 'error_message': 'Docker daemon not running or not responsive'}
|
data_ret = {'status': 0, 'error_message': 'Docker daemon not running or not responsive'}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -45,4 +47,5 @@ def preDockerRun(function):
|
|||||||
return render(request, 'dockerManager/install.html', {'status':admin.type, 'conErr':1})
|
return render(request, 'dockerManager/install.html', {'status':admin.type, 'conErr':1})
|
||||||
|
|
||||||
return function(request, *args, **kwargs)
|
return function(request, *args, **kwargs)
|
||||||
|
|
||||||
return wrap
|
return wrap
|
||||||
@@ -13,5 +13,6 @@ class Containers(models.Model):
|
|||||||
tag = models.CharField(max_length=50, default='unknown')
|
tag = models.CharField(max_length=50, default='unknown')
|
||||||
memory = models.IntegerField(default=0)
|
memory = models.IntegerField(default=0)
|
||||||
ports = models.TextField(default="{}")
|
ports = models.TextField(default="{}")
|
||||||
|
volumes = models.TextField(default="{}")
|
||||||
env = models.TextField(default="{}")
|
env = models.TextField(default="{}")
|
||||||
startOnReboot = models.IntegerField(default=0)
|
startOnReboot = models.IntegerField(default=0)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
app.controller('installDocker', function ($scope, $http, $timeout, $window) {
|
app.controller('installDocker', function ($scope, $http, $timeout, $window) {
|
||||||
$scope.installDockerStatus = true;
|
$scope.installDockerStatus = true;
|
||||||
$scope.installBoxGen = true;
|
$scope.installBoxGen = true;
|
||||||
@@ -120,18 +118,27 @@ app.controller('runContainer', function ($scope, $http) {
|
|||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
$scope.goBackDisable = true;
|
$scope.goBackDisable = true;
|
||||||
|
|
||||||
|
$scope.volList = {};
|
||||||
|
$scope.volListNumber = 0;
|
||||||
|
$scope.addVolField = function () {
|
||||||
|
$scope.volList[$scope.volListNumber] = {'dest': '', 'src': ''};
|
||||||
|
$scope.volListNumber = $scope.volListNumber + 1;
|
||||||
|
console.log($scope.volList)
|
||||||
|
};
|
||||||
|
$scope.removeVolField = function () {
|
||||||
|
delete $scope.volList[$scope.volListNumber - 1];
|
||||||
|
$scope.volListNumber = $scope.volListNumber - 1;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.addEnvField = function () {
|
$scope.addEnvField = function () {
|
||||||
var countEnv = Object.keys($scope.envList).length;
|
var countEnv = Object.keys($scope.envList).length;
|
||||||
$scope.envList[countEnv + 1] = {'name': '', 'value': ''};
|
$scope.envList[countEnv + 1] = {'name': '', 'value': ''};
|
||||||
}
|
};
|
||||||
|
|
||||||
var statusFile;
|
var statusFile;
|
||||||
|
|
||||||
$scope.createContainer = function () {
|
$scope.createContainer = function () {
|
||||||
|
|
||||||
console.log($scope.iport);
|
|
||||||
console.log($scope.portType);
|
|
||||||
|
|
||||||
$scope.containerCreationLoading = true;
|
$scope.containerCreationLoading = true;
|
||||||
$scope.installationDetailsForm = true;
|
$scope.installationDetailsForm = true;
|
||||||
$scope.installationProgress = false;
|
$scope.installationProgress = false;
|
||||||
@@ -157,7 +164,8 @@ app.controller('runContainer', function ($scope, $http) {
|
|||||||
memory: memory,
|
memory: memory,
|
||||||
dockerOwner: dockerOwner,
|
dockerOwner: dockerOwner,
|
||||||
image: image,
|
image: image,
|
||||||
envList: $scope.envList
|
envList: $scope.envList,
|
||||||
|
volList: $scope.volList
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,8 +173,6 @@ app.controller('runContainer', function ($scope, $http) {
|
|||||||
data[port + "/" + protocol] = $scope.eport[port];
|
data[port + "/" + protocol] = $scope.eport[port];
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(data)
|
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
@@ -314,7 +320,7 @@ app.controller('listContainers', function ($scope, $http) {
|
|||||||
if (response.data.delContainerStatus === 1) {
|
if (response.data.delContainerStatus === 1) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
else if (response.data.delContainerStatus == 2) {
|
else if (response.data.delContainerStatus === 2) {
|
||||||
(new PNotify({
|
(new PNotify({
|
||||||
title: response.data.error_message,
|
title: response.data.error_message,
|
||||||
text: 'Delete anyway?',
|
text: 'Delete anyway?',
|
||||||
@@ -382,7 +388,6 @@ app.controller('listContainers', function ($scope, $http) {
|
|||||||
else {
|
else {
|
||||||
name = $scope.activeLog;
|
name = $scope.activeLog;
|
||||||
}
|
}
|
||||||
console.log(name)
|
|
||||||
$scope.logs = "Loading...";
|
$scope.logs = "Loading...";
|
||||||
|
|
||||||
url = "/docker/getContainerLogs";
|
url = "/docker/getContainerLogs";
|
||||||
@@ -420,7 +425,7 @@ app.controller('listContainers', function ($scope, $http) {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
url = "/docker/getContainerList";
|
url = "/docker/getContainerList";
|
||||||
|
|
||||||
@@ -697,7 +702,16 @@ app.controller('viewContainer', function ($scope, $http) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
|
$scope.addVolField = function () {
|
||||||
|
$scope.volList[$scope.volListNumber] = {'dest': '', 'src': ''};
|
||||||
|
$scope.volListNumber = $scope.volListNumber + 1;
|
||||||
|
};
|
||||||
|
$scope.removeVolField = function () {
|
||||||
|
delete $scope.volList[$scope.volListNumber - 1];
|
||||||
|
$scope.volListNumber = $scope.volListNumber - 1;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.saveSettings = function () {
|
$scope.saveSettings = function () {
|
||||||
$('#containerSettingLoading').show();
|
$('#containerSettingLoading').show();
|
||||||
@@ -709,10 +723,11 @@ app.controller('viewContainer', function ($scope, $http) {
|
|||||||
memory: $scope.memory,
|
memory: $scope.memory,
|
||||||
startOnReboot: $scope.startOnReboot,
|
startOnReboot: $scope.startOnReboot,
|
||||||
envConfirmation: $scope.envConfirmation,
|
envConfirmation: $scope.envConfirmation,
|
||||||
envList: $scope.envList
|
envList: $scope.envList,
|
||||||
|
volList: $scope.volList
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(data)
|
|
||||||
var config = {
|
var config = {
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
|||||||
@@ -107,11 +107,38 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="installationDetailsForm" class="col-md-offset-3">
|
<div ng-hide="installationDetailsForm" class="col-md-offset-3">
|
||||||
<button type="button" class="btn btn-info" ng-click="addEnvField()">Add more</button>
|
<button type="button" class="btn btn-info" ng-click="addEnvField()">Add more</button>
|
||||||
</div><br>
|
</div><br>
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="form-group text-center">
|
||||||
|
<label class="control-label">
|
||||||
|
{% trans "Map Volumes" %}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div ng-repeat="volume in volList track by $index">
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
|
<div class="col-sm-3"></div>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<input type="text" class="form-control" ng-model="volList[$index].dest" placeholder="Destination" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input type="text" class="form-control" ng-model="volList[$index].src" placeholder="Source" required>
|
||||||
|
</div>
|
||||||
|
<div ng-show="$last">
|
||||||
|
<div class="col-sm-1">
|
||||||
|
<button class="btn btn-primary" type="button" ng-click="removeVolField()"><i class="fa fa-times"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="text-center">
|
||||||
|
<button type="button" class="btn btn-info" ng-click="addVolField()">{% trans "Add field" %}</button>
|
||||||
|
</div><br>
|
||||||
|
|
||||||
<div ng-hide="installationDetailsForm" class="form-group">
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
<label class="col-sm-3 control-label"></label>
|
<label class="col-sm-3 control-label"></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
|
|||||||
@@ -210,21 +210,21 @@
|
|||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input ng-model="envConfirmation" type="checkbox">
|
<input ng-model="envConfirmation" type="checkbox">
|
||||||
Editing ENV will recreate container <i class="fa fa-warning" title="If you tick this checkbox, your container will be recreated with saved information. Data saved inside container will be deleted (Not avaialble for container created outside of cyberpanel)"></i>
|
Editing ENV or Volume will recreate container <i class="fa fa-warning" title="If you tick this checkbox, your container will be recreated with saved information. Data saved inside container will be deleted (Not avaialble for container created outside of cyberpanel)"></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr>
|
||||||
<span ng-init="envList = {}"></span>
|
<span ng-init="envList = {}"></span>
|
||||||
{% for env, value in envList.items %}
|
{% for env, value in envList.items %}
|
||||||
|
|
||||||
<span ng-init="envList[{{ forloop.counter0 }}] = {'name':'{{env}}' , 'value':'{{value}}'} "></span>
|
<span ng-init="envList[{{ forloop.counter0 }}] = {'name':'{{env}}' , 'value':'{{value}}'} "></span>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<div ng-repeat="env in envList track by $index">
|
<div ng-repeat="env in envList track by $index">
|
||||||
|
|
||||||
<div ng-hide="installationDetailsForm" class="form-group">
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
<label class="col-sm-3 control-label">
|
<label class="col-sm-3 control-label">
|
||||||
<div ng-show="$first">
|
<div ng-show="$first">
|
||||||
@@ -238,12 +238,49 @@
|
|||||||
<input name="$index" type="text" class="form-control" ng-model="envList[$index].value" required>
|
<input name="$index" type="text" class="form-control" ng-model="envList[$index].value" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-offset-3">
|
<div class="col-md-offset-3">
|
||||||
<button type="button" class="btn btn-info" ng-click="addEnvField()">Add more</button>
|
<button type="button" class="btn btn-info" ng-click="addEnvField()">Add more</button>
|
||||||
</div><br>
|
</div><br>
|
||||||
|
|
||||||
|
<span ng-init="volList = {}"></span>
|
||||||
|
{% for key, value in volList.items %}
|
||||||
|
|
||||||
|
<span ng-init="volList[{{ forloop.counter0 }}] = {'dest':'{{value.bind}}' , 'src':'{{key}}'}"></span>
|
||||||
|
<span ng-init="volListNumber={{ forloop.counter0 }} + 1"></span>
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="form-group text-center">
|
||||||
|
<label class="control-label">
|
||||||
|
{% trans "Map Volumes" %}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div ng-repeat="volume in volList track by $index">
|
||||||
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
|
<div class="col-sm-3"></div>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<input type="text" class="form-control" ng-model="volList[$index].dest" placeholder="Destination" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<input type="text" class="form-control" ng-model="volList[$index].src" placeholder="Source" required>
|
||||||
|
</div>
|
||||||
|
<div ng-show="$last">
|
||||||
|
<div class="col-sm-1">
|
||||||
|
<button class="btn btn-primary" type="button" ng-click="removeVolField()"><i class="fa fa-times"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="text-center">
|
||||||
|
<button type="button" class="btn btn-info" ng-click="addVolField()">{% trans "Add field" %}</button>
|
||||||
|
</div><br>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
|||||||
from django.shortcuts import render, redirect, HttpResponse
|
from django.shortcuts import render, redirect, HttpResponse
|
||||||
from loginSystem.models import Administrator
|
from loginSystem.models import Administrator
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
from plogical.container import ContainerManager
|
from .container import ContainerManager
|
||||||
from decorators import preDockerRun
|
from decorators import preDockerRun
|
||||||
from plogical.acl import ACLManager
|
from plogical.acl import ACLManager
|
||||||
import json
|
import json
|
||||||
|
|||||||
@@ -780,7 +780,7 @@ class preFlightsChecks:
|
|||||||
|
|
||||||
os.chdir(self.path)
|
os.chdir(self.path)
|
||||||
|
|
||||||
command = "wget http://cyberpanel.sh/CyberPanel.1.7.7.tar.gz"
|
command = "wget http://cyberpanel.sh/CyberPanel.1.8.0.tar.gz"
|
||||||
#command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz"
|
#command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz"
|
||||||
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
|
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
|
||||||
'CyberPanel Download',
|
'CyberPanel Download',
|
||||||
@@ -789,7 +789,7 @@ class preFlightsChecks:
|
|||||||
##
|
##
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
command = "tar zxf CyberPanel.1.7.7.tar.gz"
|
command = "tar zxf CyberPanel.1.8.0.tar.gz"
|
||||||
#command = "tar zxf CyberPanelTemp.tar.gz"
|
#command = "tar zxf CyberPanelTemp.tar.gz"
|
||||||
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
|
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
|
||||||
'Extract CyberPanel',1, 1, os.EX_OSERR)
|
'Extract CyberPanel',1, 1, os.EX_OSERR)
|
||||||
|
|||||||
@@ -45,13 +45,13 @@ init()
|
|||||||
|
|
||||||
DIR_OWN="nobody:nobody"
|
DIR_OWN="nobody:nobody"
|
||||||
CONF_OWN="nobody:nobody"
|
CONF_OWN="nobody:nobody"
|
||||||
|
|
||||||
BUILD_ROOT="$LSWS_HOME/../../../"
|
BUILD_ROOT="$LSWS_HOME/../../../"
|
||||||
WHM_CGIDIR="$BUILD_ROOT/usr/local/cpanel/whostmgr/docroot/cgi"
|
WHM_CGIDIR="$BUILD_ROOT/usr/local/cpanel/whostmgr/docroot/cgi"
|
||||||
if [ -d "$WHM_CGIDIR" ] ; then
|
if [ -d "$WHM_CGIDIR" ] ; then
|
||||||
HOST_PANEL="cpanel"
|
HOST_PANEL="cpanel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
license()
|
license()
|
||||||
@@ -59,14 +59,14 @@ license()
|
|||||||
SUCC=0
|
SUCC=0
|
||||||
TRY=1
|
TRY=1
|
||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
printf "%s" "Do you agree with above license? "
|
printf "%s" "Do you agree with above license? "
|
||||||
YES_NO='Yes'
|
YES_NO='Yes'
|
||||||
if [ "x$YES_NO" != "xYes" ]; then
|
if [ "x$YES_NO" != "xYes" ]; then
|
||||||
if [ $TRY -lt 3 ]; then
|
if [ $TRY -lt 3 ]; then
|
||||||
echo "Sorry, wrong answer! Type 'Yes' with capital 'Y', try again!"
|
echo "Sorry, wrong answer! Type 'Yes' with capital 'Y', try again!"
|
||||||
TRY=`expr $TRY + 1`
|
TRY=`expr $TRY + 1`
|
||||||
else
|
else
|
||||||
echo "Abort installation!"
|
echo "Abort installation!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -114,11 +114,11 @@ install_dir()
|
|||||||
DEST_RECOM="/opt/lsws"
|
DEST_RECOM="/opt/lsws"
|
||||||
fi
|
fi
|
||||||
WS_USER="nobody"
|
WS_USER="nobody"
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
As you are not the 'root' user, you may not be able to install the
|
As you are not the 'root' user, you may not be able to install the
|
||||||
web server into a system directory or enable chroot, the web server
|
web server into a system directory or enable chroot, the web server
|
||||||
process will run on behalf of current user - '$INST_USER'.
|
process will run on behalf of current user - '$INST_USER'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -131,8 +131,8 @@ EOF
|
|||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Please specify the destination directory. You must have permissions to
|
Please specify the destination directory. You must have permissions to
|
||||||
create and manage the directory. It is recommended to install the web server
|
create and manage the directory. It is recommended to install the web server
|
||||||
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
|
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
|
||||||
|
|
||||||
ATTENTION: The user '$WS_USER' must be able to access the destination
|
ATTENTION: The user '$WS_USER' must be able to access the destination
|
||||||
@@ -145,7 +145,7 @@ EOF
|
|||||||
if [ "x$TMP_DEST" = "x" ]; then
|
if [ "x$TMP_DEST" = "x" ]; then
|
||||||
TMP_DEST=$DEST_RECOM
|
TMP_DEST=$DEST_RECOM
|
||||||
fi
|
fi
|
||||||
if [ `expr "$TMP_DEST" : '~'` -gt 0 ]; then
|
if [ `expr "$TMP_DEST" : '~'` -gt 0 ]; then
|
||||||
LSWS_HOME="$HOME`echo $TMP_DEST | sed 's/^~//' `"
|
LSWS_HOME="$HOME`echo $TMP_DEST | sed 's/^~//' `"
|
||||||
else
|
else
|
||||||
LSWS_HOME=$TMP_DEST
|
LSWS_HOME=$TMP_DEST
|
||||||
@@ -164,11 +164,11 @@ EOF
|
|||||||
if [ -f "$LSWS_HOME/conf/httpd_config.xml" ]; then
|
if [ -f "$LSWS_HOME/conf/httpd_config.xml" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Found old configuration file under destination directory $LSWS_HOME.
|
Found old configuration file under destination directory $LSWS_HOME.
|
||||||
|
|
||||||
To upgrade, press 'Enter', current configuration will not be changed.
|
To upgrade, press 'Enter', current configuration will not be changed.
|
||||||
To reinstall, press 'R' or 'r'.
|
To reinstall, press 'R' or 'r'.
|
||||||
To change directory, press 'C' or 'c'.
|
To change directory, press 'C' or 'c'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -178,15 +178,15 @@ EOF
|
|||||||
if [ "x$TMP_URC" = "x" ]; then
|
if [ "x$TMP_URC" = "x" ]; then
|
||||||
INSTALL_TYPE="upgrade"
|
INSTALL_TYPE="upgrade"
|
||||||
SET_LOGIN=0
|
SET_LOGIN=0
|
||||||
else
|
else
|
||||||
if [ `expr "$TMP_URC" : '[Uu]'` -gt 0 ]; then
|
if [ `expr "$TMP_URC" : '[Uu]'` -gt 0 ]; then
|
||||||
INSTALL_TYPE="upgrade"
|
INSTALL_TYPE="upgrade"
|
||||||
SET_LOGIN=0
|
SET_LOGIN=0
|
||||||
else
|
else
|
||||||
if [ `expr "$TMP_URC" : '[Rr]'` -gt 0 ]; then
|
if [ `expr "$TMP_URC" : '[Rr]'` -gt 0 ]; then
|
||||||
INSTALL_TYPE="reinstall"
|
INSTALL_TYPE="reinstall"
|
||||||
SET_LOGIN=1
|
SET_LOGIN=1
|
||||||
else
|
else
|
||||||
#if [ `expr "$TMP_URC" : '[Cc]'` -gt 0 ]; then
|
#if [ `expr "$TMP_URC" : '[Cc]'` -gt 0 ]; then
|
||||||
SUCC=0
|
SUCC=0
|
||||||
fi
|
fi
|
||||||
@@ -224,7 +224,7 @@ admin_login()
|
|||||||
SET_LOGIN=1
|
SET_LOGIN=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $SET_LOGIN -eq 1 ]; then
|
if [ $SET_LOGIN -eq 1 ]; then
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ a non-system user who does not have login shell and home directory such as
|
|||||||
'nobody'.
|
'nobody'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
# get user name
|
# get user name
|
||||||
SUCC=0
|
SUCC=0
|
||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
printf "%s" "User [$WS_USER]: "
|
printf "%s" "User [$WS_USER]: "
|
||||||
@@ -312,22 +312,22 @@ EOF
|
|||||||
TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
|
TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
|
||||||
if [ "x$TST_USER" = "x$TMP_USER" ]; then
|
if [ "x$TST_USER" = "x$TMP_USER" ]; then
|
||||||
USER_ID=`expr "$USER_INFO" : 'uid=\(.*\)(.*) gid=.*'`
|
USER_ID=`expr "$USER_INFO" : 'uid=\(.*\)(.*) gid=.*'`
|
||||||
if [ $USER_ID -gt 10 ]; then
|
if [ $USER_ID -gt 10 ]; then
|
||||||
WS_USER=$TMP_USER
|
WS_USER=$TMP_USER
|
||||||
SUCC=1
|
SUCC=1
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
[ERROR] It is not allowed to run LiteSpeed web server on behalf of a
|
[ERROR] It is not allowed to run LiteSpeed web server on behalf of a
|
||||||
privileged user, user id must be greater than 10. The user id of user
|
privileged user, user id must be greater than 10. The user id of user
|
||||||
'$TMP_USER' is '$USER_ID'.
|
'$TMP_USER' is '$USER_ID'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
[ERROR] '$TMP_USER' is not valid user name in your system, please choose
|
[ERROR] '$TMP_USER' is not valid user name in your system, please choose
|
||||||
another user or create user '$TMP_USER' first.
|
another user or create user '$TMP_USER' first.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -336,7 +336,7 @@ EOF
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get group name
|
# get group name
|
||||||
SUCC=0
|
SUCC=0
|
||||||
TMP_GROUPS=`groups $WS_USER`
|
TMP_GROUPS=`groups $WS_USER`
|
||||||
TST_GROUPS=`expr "$TMP_GROUPS" : '.*:\(.*\)'`
|
TST_GROUPS=`expr "$TMP_GROUPS" : '.*:\(.*\)'`
|
||||||
@@ -347,7 +347,7 @@ EOF
|
|||||||
D_GROUP=`$ID_GROUPS $WS_USER`
|
D_GROUP=`$ID_GROUPS $WS_USER`
|
||||||
D_GROUP=`expr "$D_GROUP" : '.*gid=[0-9]*(\(.*\)) groups=.*'`
|
D_GROUP=`expr "$D_GROUP" : '.*gid=[0-9]*(\(.*\)) groups=.*'`
|
||||||
echo "Please choose the group that the web server running as."
|
echo "Please choose the group that the web server running as."
|
||||||
echo
|
echo
|
||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
echo "User '$WS_USER' is the member of following group(s): $TST_GROUPS"
|
echo "User '$WS_USER' is the member of following group(s): $TST_GROUPS"
|
||||||
printf "%s" "Group [$D_GROUP]: "
|
printf "%s" "Group [$D_GROUP]: "
|
||||||
@@ -363,7 +363,7 @@ EOF
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
[ERROR] '$TMP_GROUP' is not valid group for user '$WS_USER', please choose
|
[ERROR] '$TMP_GROUP' is not valid group for user '$WS_USER', please choose
|
||||||
another group in the list or add user '$WS_USER' to group '$TMP_GROUP'
|
another group in the list or add user '$WS_USER' to group '$TMP_GROUP'
|
||||||
first.
|
first.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -385,7 +385,7 @@ stopLshttpd()
|
|||||||
RUNNING_PROCESS=`$PS_CMD | grep lshttpd | grep -v grep`
|
RUNNING_PROCESS=`$PS_CMD | grep lshttpd | grep -v grep`
|
||||||
if [ "x$RUNNING_PROCESS" != "x" ]; then
|
if [ "x$RUNNING_PROCESS" != "x" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
LiteSpeed web server is running, in order to continue installation, the server
|
LiteSpeed web server is running, in order to continue installation, the server
|
||||||
must be stopped.
|
must be stopped.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -415,7 +415,7 @@ getServerPort()
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Please specify the port for normal HTTP service.
|
Please specify the port for normal HTTP service.
|
||||||
Port 80 is the standard HTTP port, only 'root' user is allowed to use
|
Port 80 is the standard HTTP port, only 'root' user is allowed to use
|
||||||
port 80, if you have another web server running on port 80, you need to
|
port 80, if you have another web server running on port 80, you need to
|
||||||
specify another port or stop the other web server before starting LiteSpeed
|
specify another port or stop the other web server before starting LiteSpeed
|
||||||
Web Server.
|
Web Server.
|
||||||
@@ -513,9 +513,9 @@ configAdminEmail()
|
|||||||
|
|
||||||
Please specify administrators' email addresses.
|
Please specify administrators' email addresses.
|
||||||
It is recommended to specify a real email address,
|
It is recommended to specify a real email address,
|
||||||
Multiple email addresses can be set by a comma
|
Multiple email addresses can be set by a comma
|
||||||
delimited list of email addresses. Whenever something
|
delimited list of email addresses. Whenever something
|
||||||
abnormal happened, a notificiation will be sent to
|
abnormal happened, a notificiation will be sent to
|
||||||
emails listed here.
|
emails listed here.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -550,9 +550,9 @@ enablePHPHandler()
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
You can setup a global script handler for PHP with the pre-built PHP engine
|
You can setup a global script handler for PHP with the pre-built PHP engine
|
||||||
shipped with this package now. The PHP engine runs as Fast CGI which
|
shipped with this package now. The PHP engine runs as Fast CGI which
|
||||||
outperforms Apache's mod_php.
|
outperforms Apache's mod_php.
|
||||||
You can always replace the pre-built PHP engine with your customized PHP
|
You can always replace the pre-built PHP engine with your customized PHP
|
||||||
engine.
|
engine.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -568,7 +568,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
if [ $SETUP_PHP -eq 1 ]; then
|
if [ $SETUP_PHP -eq 1 ]; then
|
||||||
PHP_SUFFIX="php"
|
PHP_SUFFIX="php"
|
||||||
printf "%s" "Suffix for PHP script(comma separated list) [$PHP_SUFFIX]: "
|
printf "%s" "Suffix for PHP script(comma separated list) [$PHP_SUFFIX]: "
|
||||||
TMP_SUFFIX='php'
|
TMP_SUFFIX='php'
|
||||||
if [ "x$TMP_SUFFIX" != "x" ]; then
|
if [ "x$TMP_SUFFIX" != "x" ]; then
|
||||||
PHP_SUFFIX=$TMP_SUFFIX
|
PHP_SUFFIX=$TMP_SUFFIX
|
||||||
@@ -677,7 +677,7 @@ util_mkdir()
|
|||||||
chown "$OWNER" "$LSWS_HOME/$arg"
|
chown "$OWNER" "$LSWS_HOME/$arg"
|
||||||
chmod $PERM "$LSWS_HOME/$arg"
|
chmod $PERM "$LSWS_HOME/$arg"
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -693,7 +693,7 @@ util_cpfile()
|
|||||||
chown "$OWNER" "$LSWS_HOME/$arg"
|
chown "$OWNER" "$LSWS_HOME/$arg"
|
||||||
chmod $PERM "$LSWS_HOME/$arg"
|
chmod $PERM "$LSWS_HOME/$arg"
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
util_ccpfile()
|
util_ccpfile()
|
||||||
@@ -883,31 +883,31 @@ create_lsadm_freebsd()
|
|||||||
{
|
{
|
||||||
pw group add lsadm
|
pw group add lsadm
|
||||||
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
||||||
pw user add -g $lsadm_gid -d / -s /usr/sbin/nologin -n lsadm
|
pw user add -g $lsadm_gid -d / -s /usr/sbin/nologin -n lsadm
|
||||||
pw usermod lsadm -G $WS_GROUP
|
pw usermod lsadm -G $WS_GROUP
|
||||||
}
|
}
|
||||||
|
|
||||||
create_lsadm()
|
create_lsadm()
|
||||||
{
|
{
|
||||||
groupadd lsadm
|
groupadd lsadm
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
||||||
useradd -g $lsadm_gid -d / -r -s /sbin/nologin lsadm
|
useradd -g $lsadm_gid -d / -r -s /sbin/nologin lsadm
|
||||||
usermod -a -G $WS_GROUP lsadm
|
usermod -a -G $WS_GROUP lsadm
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create_lsadm_solaris()
|
create_lsadm_solaris()
|
||||||
{
|
{
|
||||||
groupadd lsadm
|
groupadd lsadm
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F: '{ print $3; }'`
|
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F: '{ print $3; }'`
|
||||||
useradd -g $lsadm_gid -d / -s /bin/false lsadm
|
useradd -g $lsadm_gid -d / -s /bin/false lsadm
|
||||||
usermod -G $WS_GROUP lsadm
|
usermod -G $WS_GROUP lsadm
|
||||||
|
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -946,7 +946,7 @@ installation()
|
|||||||
create_lsadm_freebsd
|
create_lsadm_freebsd
|
||||||
elif [ "x$SYS_NAME" = "xSunOS" ]; then
|
elif [ "x$SYS_NAME" = "xSunOS" ]; then
|
||||||
create_lsadm_solaris
|
create_lsadm_solaris
|
||||||
fi
|
fi
|
||||||
grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1
|
grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
CONF_OWN="lsadm:lsadm"
|
CONF_OWN="lsadm:lsadm"
|
||||||
@@ -959,33 +959,33 @@ installation()
|
|||||||
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc"
|
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc"
|
||||||
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo"
|
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo"
|
||||||
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lshttpd.service.in" > "$LSINSTALL_DIR/admin/misc/lshttpd.service"
|
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lshttpd.service.in" > "$LSINSTALL_DIR/admin/misc/lshttpd.service"
|
||||||
|
|
||||||
if [ -d "$LSWS_HOME/admin/html.$VERSION" ]; then
|
if [ -d "$LSWS_HOME/admin/html.$VERSION" ]; then
|
||||||
rm -rf "$LSWS_HOME/admin/html.$VERSION"
|
rm -rf "$LSWS_HOME/admin/html.$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD admin bin docs fcgi-bin lib logs admin/logs add-ons share admin/fcgi-bin
|
util_mkdir "$SDIR_OWN" $DIR_MOD admin bin docs fcgi-bin lib logs admin/logs add-ons share admin/fcgi-bin
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD admin/html.$VERSION admin/misc
|
util_mkdir "$SDIR_OWN" $DIR_MOD admin/html.$VERSION admin/misc
|
||||||
util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates admin/conf admin/conf/cert admin/tmp phpbuild autoupdate
|
util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates admin/conf admin/conf/cert admin/tmp phpbuild autoupdate
|
||||||
util_mkdir "$SDIR_OWN" $SDIR_MOD admin/cgid admin/cgid/secret
|
util_mkdir "$SDIR_OWN" $SDIR_MOD admin/cgid admin/cgid/secret
|
||||||
util_mkdir "$CONF_OWN" $DIR_MOD admin/htpasswds
|
util_mkdir "$CONF_OWN" $DIR_MOD admin/htpasswds
|
||||||
chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
||||||
chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
||||||
chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1
|
chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT
|
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT
|
||||||
|
|
||||||
buildAdminSslCert
|
buildAdminSslCert
|
||||||
|
|
||||||
find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null
|
find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
find "$LSWS_HOME/admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f
|
find "$LSWS_HOME/admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find "/tmp/lshttpd" -type s -atime +1 -delete 2>/dev/null
|
find "/tmp/lshttpd" -type s -atime +1 -delete 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
find "/tmp/lshttpd" -type s -atime +1 2>/dev/null | xargs rm -f
|
find "/tmp/lshttpd" -type s -atime +1 2>/dev/null | xargs rm -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$HOST_PANEL" = "xcpanel" ]; then
|
if [ "x$HOST_PANEL" = "xcpanel" ]; then
|
||||||
if [ ! -d "$BUILD_ROOT/usr/local/lib/php/autoindex/" ]; then
|
if [ ! -d "$BUILD_ROOT/usr/local/lib/php/autoindex/" ]; then
|
||||||
@@ -1012,21 +1012,21 @@ installation()
|
|||||||
fi
|
fi
|
||||||
util_cpdir "$SDIR_OWN" $DOC_MOD add-ons
|
util_cpdir "$SDIR_OWN" $DOC_MOD add-ons
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD add-ons/modsec/inspectmulti.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD add-ons/modsec/inspectmulti.sh
|
||||||
|
|
||||||
util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl
|
util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RackRunner.rb fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3
|
util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RackRunner.rb fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/fcgi-bin/admin_php5
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/fcgi-bin/admin_php5
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/rc-inst.sh admin/misc/admpass.sh admin/misc/rc-uninst.sh admin/misc/uninstall.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/rc-inst.sh admin/misc/admpass.sh admin/misc/rc-uninst.sh admin/misc/uninstall.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lsws.rc admin/misc/lshttpd.service admin/misc/lsws.rc.gentoo admin/misc/enable_ruby_python_selector.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lsws.rc admin/misc/lshttpd.service admin/misc/lsws.rc.gentoo admin/misc/enable_ruby_python_selector.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/mgr_ver.sh admin/misc/gzipStatic.sh admin/misc/fp_install.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/mgr_ver.sh admin/misc/gzipStatic.sh admin/misc/fp_install.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/create_admin_keypair.sh admin/misc/awstats_install.sh admin/misc/update.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/create_admin_keypair.sh admin/misc/awstats_install.sh admin/misc/update.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/cleancache.sh admin/misc/cleanlitemage.sh admin/misc/lsup5.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/cleancache.sh admin/misc/cleanlitemage.sh admin/misc/lsup5.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/fix_cagefs.sh admin/misc/cp_switch_ws.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/fix_cagefs.sh admin/misc/cp_switch_ws.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lscmctl
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lscmctl
|
||||||
ln -sf ./lsup5.sh "$LSWS_HOME/admin/misc/lsup.sh"
|
ln -sf ./lsup5.sh "$LSWS_HOME/admin/misc/lsup.sh"
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/ap_lsws.sh.in admin/misc/build_ap_wrapper.sh admin/misc/cpanel_restart_httpd.in
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/ap_lsws.sh.in admin/misc/build_ap_wrapper.sh admin/misc/cpanel_restart_httpd.in
|
||||||
util_cpfile "$SDIR_OWN" $DOC_MOD admin/misc/gdb-bt admin/misc/htpasswd.php admin/misc/php.ini admin/misc/genjCryptionKeyPair.php admin/misc/purge_cache_byurl.php
|
util_cpfile "$SDIR_OWN" $DOC_MOD admin/misc/gdb-bt admin/misc/htpasswd.php admin/misc/php.ini admin/misc/genjCryptionKeyPair.php admin/misc/purge_cache_byurl.php
|
||||||
|
|
||||||
if [ -f "$LSINSTALL_DIR/admin/misc/chroot.sh" ]; then
|
if [ -f "$LSINSTALL_DIR/admin/misc/chroot.sh" ]; then
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh
|
||||||
fi
|
fi
|
||||||
@@ -1043,7 +1043,7 @@ installation()
|
|||||||
chown $CONF_OWN "$LSWS_HOME/admin/htpasswds/status"
|
chown $CONF_OWN "$LSWS_HOME/admin/htpasswds/status"
|
||||||
chgrp $WS_GROUP "$LSWS_HOME/admin/htpasswds/status"
|
chgrp $WS_GROUP "$LSWS_HOME/admin/htpasswds/status"
|
||||||
chmod 0640 "$LSWS_HOME/admin/htpasswds/status"
|
chmod 0640 "$LSWS_HOME/admin/htpasswds/status"
|
||||||
|
|
||||||
if [ $INSTALL_TYPE = "upgrade" ]; then
|
if [ $INSTALL_TYPE = "upgrade" ]; then
|
||||||
util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml
|
util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml
|
||||||
util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini
|
util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini
|
||||||
@@ -1067,7 +1067,7 @@ installation()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$LSWS_HOME/DEFAULT/conf/vhconf.xml" ]; then
|
if [ ! -f "$LSWS_HOME/DEFAULT/conf/vhconf.xml" ]; then
|
||||||
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
||||||
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -1077,7 +1077,7 @@ installation()
|
|||||||
util_cpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties
|
util_cpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties
|
||||||
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
||||||
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT/html DEFAULT/cgi-bin
|
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT/html DEFAULT/cgi-bin
|
||||||
util_cpdir "$SDIR_OWN" $DOC_MOD DEFAULT/html DEFAULT/cgi-bin
|
util_cpdir "$SDIR_OWN" $DOC_MOD DEFAULT/html DEFAULT/cgi-bin
|
||||||
fi
|
fi
|
||||||
if [ $SETUP_PHP -eq 1 ]; then
|
if [ $SETUP_PHP -eq 1 ]; then
|
||||||
@@ -1110,26 +1110,26 @@ installation()
|
|||||||
|
|
||||||
|
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD bin/wswatch.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD bin/wswatch.sh
|
||||||
util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lswsctrl bin/lshttpd bin/lscgid
|
util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lswsctrl bin/lshttpd bin/lscgid
|
||||||
|
|
||||||
$TEST_BIN ! -L "$LSWS_HOME/modules"
|
$TEST_BIN ! -L "$LSWS_HOME/modules"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
mv -f "$LSWS_HOME/modules" "$LSWS_HOME/modules.old"
|
mv -f "$LSWS_HOME/modules" "$LSWS_HOME/modules.old"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "$LSWS_HOME/modules.$VERSION" ]; then
|
if [ -d "$LSWS_HOME/modules.$VERSION" ]; then
|
||||||
rm -rf "$LSWS_HOME/modules.$VERSION"
|
rm -rf "$LSWS_HOME/modules.$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD modules.$VERSION
|
util_mkdir "$SDIR_OWN" $DIR_MOD modules.$VERSION
|
||||||
util_cpdirv "$SDIR_OWN" $EXEC_MOD $VERSION modules
|
util_cpdirv "$SDIR_OWN" $EXEC_MOD $VERSION modules
|
||||||
|
|
||||||
#if [ -e "$LSINSTALL_DIR/bin/lshttpd.dbg" ]; then
|
#if [ -e "$LSINSTALL_DIR/bin/lshttpd.dbg" ]; then
|
||||||
# if [ -f "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION" ]; then
|
# if [ -f "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION" ]; then
|
||||||
# rm "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION"
|
# rm "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION"
|
||||||
# fi
|
# fi
|
||||||
# util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lshttpd.dbg
|
# util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lshttpd.dbg
|
||||||
#
|
#
|
||||||
# #enable debug build for beta release
|
# #enable debug build for beta release
|
||||||
# ln -sf ./lshttpd.dbg.$VERSION $LSWS_HOME/bin/lshttpd
|
# ln -sf ./lshttpd.dbg.$VERSION $LSWS_HOME/bin/lshttpd
|
||||||
#fi
|
#fi
|
||||||
@@ -1141,10 +1141,10 @@ installation()
|
|||||||
if [ $INST_USER = "root" ]; then
|
if [ $INST_USER = "root" ]; then
|
||||||
chmod u+s "$LSWS_HOME/bin/lscgid.$VERSION"
|
chmod u+s "$LSWS_HOME/bin/lscgid.$VERSION"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
util_cpdir "$SDIR_OWN" $DOC_MOD docs/
|
util_cpdir "$SDIR_OWN" $DOC_MOD docs/
|
||||||
util_cpfile "$SDIR_OWN" $DOC_MOD VERSION BUILD LICENSE*
|
util_cpfile "$SDIR_OWN" $DOC_MOD VERSION BUILD LICENSE*
|
||||||
|
|
||||||
if [ -f $LSWS_HOME/autoupdate/download ]; then
|
if [ -f $LSWS_HOME/autoupdate/download ]; then
|
||||||
rm $LSWS_HOME/autoupdate/download
|
rm $LSWS_HOME/autoupdate/download
|
||||||
@@ -1158,12 +1158,12 @@ installation()
|
|||||||
chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair"
|
chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair"
|
||||||
chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair"
|
chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair"
|
||||||
|
|
||||||
fix_cloudlinux
|
fix_cloudlinux
|
||||||
|
|
||||||
if [ $INST_USER = "root" ]; then
|
if [ $INST_USER = "root" ]; then
|
||||||
$LSWS_HOME/admin/misc/rc-inst.sh
|
$LSWS_HOME/admin/misc/rc-inst.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1179,7 +1179,7 @@ PHP scripts by caching them in compiled state, the overhead of compiling
|
|||||||
PHP is avoided.
|
PHP is avoided.
|
||||||
|
|
||||||
Note: If an opcode cache has been installed already, you do not need to
|
Note: If an opcode cache has been installed already, you do not need to
|
||||||
change it. If you need to built PHP binary by yourself, you need to
|
change it. If you need to built PHP binary by yourself, you need to
|
||||||
built PHP opcode cache from source as well, unless the version of your
|
built PHP opcode cache from source as well, unless the version of your
|
||||||
PHP binary is same as that the pre-built PHP opcode cache built for.
|
PHP binary is same as that the pre-built PHP opcode cache built for.
|
||||||
|
|
||||||
@@ -1205,8 +1205,8 @@ installAWStats()
|
|||||||
|
|
||||||
AWStats Integration
|
AWStats Integration
|
||||||
|
|
||||||
AWStats is a popular log analyzer that generates advanced web server
|
AWStats is a popular log analyzer that generates advanced web server
|
||||||
statistics. LiteSpeed web server seamlessly integrates AWStats into
|
statistics. LiteSpeed web server seamlessly integrates AWStats into
|
||||||
its Web Admin Interface. AWStats configuration and statistics update
|
its Web Admin Interface. AWStats configuration and statistics update
|
||||||
have been taken care of by LiteSpeed web server.
|
have been taken care of by LiteSpeed web server.
|
||||||
|
|
||||||
@@ -1238,23 +1238,23 @@ Congratulations! The LiteSpeed Web Server has been successfully installed.
|
|||||||
Command line script - "$LSWS_HOME/bin/lswsctrl"
|
Command line script - "$LSWS_HOME/bin/lswsctrl"
|
||||||
can be used to start or stop the server.
|
can be used to start or stop the server.
|
||||||
|
|
||||||
It is recommended to limit access to the web administration interface.
|
It is recommended to limit access to the web administration interface.
|
||||||
Right now the interface can be accessed from anywhere where this
|
Right now the interface can be accessed from anywhere where this
|
||||||
machine can be reached over the network.
|
machine can be reached over the network.
|
||||||
|
|
||||||
Three options are available:
|
Three options are available:
|
||||||
1. If the interface needs to be accessed only from this machine, just
|
1. If the interface needs to be accessed only from this machine, just
|
||||||
change the listener for the interface to only listen on the loopback
|
change the listener for the interface to only listen on the loopback
|
||||||
interface - localhost(127.0.0.1).
|
interface - localhost(127.0.0.1).
|
||||||
2. If the interface needs to be accessible from limited IP addresses or sub
|
2. If the interface needs to be accessible from limited IP addresses or sub
|
||||||
networks, then set up access control rules for the interface accordingly.
|
networks, then set up access control rules for the interface accordingly.
|
||||||
3. If the interface has to be accessible via internet, SSL (Secure Sockets
|
3. If the interface has to be accessible via internet, SSL (Secure Sockets
|
||||||
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
|
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
|
||||||
|
|
||||||
To change configurations of the interface, login and click
|
To change configurations of the interface, login and click
|
||||||
"Interface Configuration" button on the main page.
|
"Interface Configuration" button on the main page.
|
||||||
The administration interface is located at http://localhost:<ADMIN_PORT>/
|
The administration interface is located at http://localhost:<ADMIN_PORT>/
|
||||||
or http://<ip_or_Hostname_of_this_machine>:<ADMIN_PORT>/
|
or http://<ip_or_Hostname_of_this_machine>:<ADMIN_PORT>/
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -1262,7 +1262,7 @@ EOF
|
|||||||
if [ $INSTALL_TYPE != "upgrade" ]; then
|
if [ $INSTALL_TYPE != "upgrade" ]; then
|
||||||
printf "%s\n%s" "Would you like to have LiteSpeed Web Server started automatically" "when the server restarts [Y/n]? "
|
printf "%s\n%s" "Would you like to have LiteSpeed Web Server started automatically" "when the server restarts [Y/n]? "
|
||||||
START_SERVER='y'
|
START_SERVER='y'
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ "x$START_SERVER" = "x" ]; then
|
if [ "x$START_SERVER" = "x" ]; then
|
||||||
START_SERVER=y
|
START_SERVER=y
|
||||||
@@ -1271,7 +1271,7 @@ EOF
|
|||||||
$LSWS_HOME/admin/misc/rc-inst.sh
|
$LSWS_HOME/admin/misc/rc-inst.sh
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
If you want to start the web server automatically later, just run
|
If you want to start the web server automatically later, just run
|
||||||
"$LSWS_HOME//rc-inst.sh"
|
"$LSWS_HOME//rc-inst.sh"
|
||||||
to install the service control script.
|
to install the service control script.
|
||||||
|
|
||||||
@@ -1279,12 +1279,12 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "x$HOST_PANEL" != "x" ]; then
|
if [ "x$HOST_PANEL" != "x" ]; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
The default configuration file contain support for both PHP4 and PHP5,
|
The default configuration file contain support for both PHP4 and PHP5,
|
||||||
A prebuilt PHP4 binary comes with this package, however, we recommend
|
A prebuilt PHP4 binary comes with this package, however, we recommend
|
||||||
you to build your own PHP4 and PHP5 binaries though our web console with
|
you to build your own PHP4 and PHP5 binaries though our web console with
|
||||||
the same configuration parameters as your current PHP installation. You
|
the same configuration parameters as your current PHP installation. You
|
||||||
can check your current PHP configuration via a phpinfo() page.
|
can check your current PHP configuration via a phpinfo() page.
|
||||||
|
|
||||||
Press [ENTER] to continue
|
Press [ENTER] to continue
|
||||||
@@ -1293,7 +1293,7 @@ EOF
|
|||||||
|
|
||||||
read TMP_VAL
|
read TMP_VAL
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
When you replace Apache with LiteSpeed, remember to stop Apache completely.
|
When you replace Apache with LiteSpeed, remember to stop Apache completely.
|
||||||
On most Linux servers, you should do:
|
On most Linux servers, you should do:
|
||||||
@@ -1323,7 +1323,7 @@ EOF
|
|||||||
printf "%s" "Would you like to restart it right now [Y/n]? "
|
printf "%s" "Would you like to restart it right now [Y/n]? "
|
||||||
fi
|
fi
|
||||||
START_SERVER='y'
|
START_SERVER='y'
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ "x$START_SERVER" = "x" ]; then
|
if [ "x$START_SERVER" = "x" ]; then
|
||||||
START_SERVER=y
|
START_SERVER=y
|
||||||
@@ -1361,4 +1361,3 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -473,13 +473,13 @@ fi
|
|||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Installing, please wait...
|
Installing, please wait...
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "x$HOST_PANEL" = "xdirectadmin" ]; then
|
if [ "x$HOST_PANEL" = "xdirectadmin" ]; then
|
||||||
chmod g+x /var/log/httpd/
|
chmod g+x /var/log/httpd/
|
||||||
chgrp apache /var/log/httpd/
|
chgrp apache /var/log/httpd/
|
||||||
chown apache:apache /var/log/httpd/domains
|
chown apache:apache /var/log/httpd/domains
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -503,4 +503,3 @@ fi
|
|||||||
|
|
||||||
finish
|
finish
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -67,7 +67,7 @@
|
|||||||
<div class="col-md-8 col-lg-6 clearfix center-margin">
|
<div class="col-md-8 col-lg-6 clearfix center-margin">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<h3 class="text-transform-upr font-size-17">CyberPanel <span class="opacity-80">v 1.7</span></h3>
|
<h3 class="text-transform-upr font-size-17">CyberPanel <span class="opacity-80">v 1.8</span></h3>
|
||||||
<p class="font-gray">Web Hosting Control Panel</p>
|
<p class="font-gray">Web Hosting Control Panel</p>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<ul class="reset-ul">
|
<ul class="reset-ul">
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ def loadLoginPage(request):
|
|||||||
firstName="Cyber",lastName="Panel", acl=acl, token=token)
|
firstName="Cyber",lastName="Panel", acl=acl, token=token)
|
||||||
admin.save()
|
admin.save()
|
||||||
|
|
||||||
vers = version(currentVersion="1.7", build=7)
|
vers = version(currentVersion="1.8", build=0)
|
||||||
vers.save()
|
vers.save()
|
||||||
|
|
||||||
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
package = Package(admin=admin, packageName="Default", diskSpace=1000,
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ class httpProc:
|
|||||||
return render(self.request, self.templateName)
|
return render(self.request, self.templateName)
|
||||||
else:
|
else:
|
||||||
return render(self.request, self.templateName, self.data)
|
return render(self.request, self.templateName, self.data)
|
||||||
|
|
||||||
def ajaxPre(self, status, errorMessage, success = None):
|
def ajaxPre(self, status, errorMessage, success = None):
|
||||||
final_dic = {'status': status, 'error_message': errorMessage, 'success': success}
|
final_dic = {'status': status, 'error_message': errorMessage, 'success': success}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
def ajax(self, status, errorMessage, data = None):
|
def ajax(self, status, errorMessage, data = None):
|
||||||
if data == None:
|
if data == None:
|
||||||
finalDic = {'status': status, 'error_message': errorMessage}
|
finalDic = {'status': status, 'error_message': errorMessage}
|
||||||
@@ -34,3 +36,9 @@ class httpProc:
|
|||||||
finalJson = json.dumps(finalDic)
|
finalJson = json.dumps(finalDic)
|
||||||
return HttpResponse(finalJson)
|
return HttpResponse(finalJson)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def AJAX(status, errorMessage, success = None):
|
||||||
|
final_dic = {'status': status, 'error_message': errorMessage, 'success': success}
|
||||||
|
final_json = json.dumps(final_dic)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|||||||
@@ -114,5 +114,17 @@ class ProcessUtilities:
|
|||||||
else:
|
else:
|
||||||
return ProcessUtilities.centos
|
return ProcessUtilities.centos
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def containerCheck():
|
||||||
|
try:
|
||||||
|
command = 'sudo cat /etc/cgrules.conf'
|
||||||
|
result = subprocess.call(shlex.split(command))
|
||||||
|
if result == 1:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return 1
|
||||||
|
except BaseException:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -410,6 +410,77 @@ WantedBy=multi-user.target"""
|
|||||||
CONSTRAINT `s3Backups_backuplogs_owner_id_c7cb5872_fk_s3Backups` FOREIGN KEY (`owner_id`) REFERENCES `s3Backups_backupplando` (`id`)
|
CONSTRAINT `s3Backups_backuplogs_owner_id_c7cb5872_fk_s3Backups` FOREIGN KEY (`owner_id`) REFERENCES `s3Backups_backupplando` (`id`)
|
||||||
)"""
|
)"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
cursor.execute(query)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
query = """CREATE TABLE `s3Backups_minionodes` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`endPointURL` varchar(200) NOT NULL,
|
||||||
|
`accessKey` varchar(200) NOT NULL,
|
||||||
|
`secretKey` varchar(200) NOT NULL,
|
||||||
|
`owner_id` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `endPointURL` (`endPointURL`),
|
||||||
|
UNIQUE KEY `accessKey` (`accessKey`),
|
||||||
|
KEY `s3Backups_minionodes_owner_id_e50993d9_fk_loginSyst` (`owner_id`),
|
||||||
|
CONSTRAINT `s3Backups_minionodes_owner_id_e50993d9_fk_loginSyst` FOREIGN KEY (`owner_id`) REFERENCES `loginSystem_administrator` (`id`)
|
||||||
|
)"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
cursor.execute(query)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
query = """CREATE TABLE `s3Backups_backupplanminio` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(50) NOT NULL,
|
||||||
|
`freq` varchar(50) NOT NULL,
|
||||||
|
`retention` int(11) NOT NULL,
|
||||||
|
`lastRun` varchar(50) NOT NULL,
|
||||||
|
`minioNode_id` int(11) NOT NULL,
|
||||||
|
`owner_id` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `name` (`name`),
|
||||||
|
KEY `s3Backups_backupplan_minioNode_id_a4eaf917_fk_s3Backups` (`minioNode_id`),
|
||||||
|
KEY `s3Backups_backupplan_owner_id_d6830e67_fk_loginSyst` (`owner_id`),
|
||||||
|
CONSTRAINT `s3Backups_backupplan_minioNode_id_a4eaf917_fk_s3Backups` FOREIGN KEY (`minioNode_id`) REFERENCES `s3Backups_minionodes` (`id`),
|
||||||
|
CONSTRAINT `s3Backups_backupplan_owner_id_d6830e67_fk_loginSyst` FOREIGN KEY (`owner_id`) REFERENCES `loginSystem_administrator` (`id`)
|
||||||
|
)"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
cursor.execute(query)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
query = """CREATE TABLE `s3Backups_websitesinplanminio` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`domain` varchar(100) NOT NULL,
|
||||||
|
`owner_id` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `s3Backups_websitesin_owner_id_224ce049_fk_s3Backups` (`owner_id`),
|
||||||
|
CONSTRAINT `s3Backups_websitesin_owner_id_224ce049_fk_s3Backups` FOREIGN KEY (`owner_id`) REFERENCES `s3Backups_backupplanminio` (`id`)
|
||||||
|
)"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
cursor.execute(query)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
query = """CREATE TABLE `s3Backups_backuplogsminio` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`timeStamp` varchar(200) NOT NULL,
|
||||||
|
`level` varchar(5) NOT NULL,
|
||||||
|
`msg` varchar(500) NOT NULL,
|
||||||
|
`owner_id` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `s3Backups_backuplogs_owner_id_f19e1736_fk_s3Backups` (`owner_id`),
|
||||||
|
CONSTRAINT `s3Backups_backuplogs_owner_id_f19e1736_fk_s3Backups` FOREIGN KEY (`owner_id`) REFERENCES `s3Backups_backupplanminio` (`id`)
|
||||||
|
)"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cursor.execute(query)
|
cursor.execute(query)
|
||||||
except:
|
except:
|
||||||
@@ -633,6 +704,37 @@ WantedBy=multi-user.target"""
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def containerMigrations():
|
||||||
|
try:
|
||||||
|
connection, cursor = Upgrade.setupConnection('cyberpanel')
|
||||||
|
|
||||||
|
query = """CREATE TABLE `containerization_containerlimits` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`cpuPers` varchar(10) NOT NULL,
|
||||||
|
`IO` varchar(10) NOT NULL,
|
||||||
|
`IOPS` varchar(10) NOT NULL,
|
||||||
|
`memory` varchar(10) NOT NULL,
|
||||||
|
`networkSpeed` varchar(10) NOT NULL,
|
||||||
|
`networkHexValue` varchar(10) NOT NULL,
|
||||||
|
`enforce` int(11) NOT NULL,
|
||||||
|
`owner_id` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `containerization_con_owner_id_494eb637_fk_websiteFu` (`owner_id`),
|
||||||
|
CONSTRAINT `containerization_con_owner_id_494eb637_fk_websiteFu` FOREIGN KEY (`owner_id`) REFERENCES `websiteFunctions_websites` (`id`)
|
||||||
|
)"""
|
||||||
|
try:
|
||||||
|
cursor.execute(query)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
connection.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def enableServices():
|
def enableServices():
|
||||||
try:
|
try:
|
||||||
@@ -705,6 +807,11 @@ WantedBy=multi-user.target"""
|
|||||||
if items.find('dockerManager') > -1:
|
if items.find('dockerManager') > -1:
|
||||||
dockerManager = 0
|
dockerManager = 0
|
||||||
|
|
||||||
|
containerization = 1
|
||||||
|
for items in data:
|
||||||
|
if items.find('containerization') > -1:
|
||||||
|
containerization = 0
|
||||||
|
|
||||||
|
|
||||||
Upgrade.stdOut('Restoring settings file!')
|
Upgrade.stdOut('Restoring settings file!')
|
||||||
|
|
||||||
@@ -724,6 +831,10 @@ WantedBy=multi-user.target"""
|
|||||||
writeToFile.writelines(" 's3Backups',\n")
|
writeToFile.writelines(" 's3Backups',\n")
|
||||||
if dockerManager == 1:
|
if dockerManager == 1:
|
||||||
writeToFile.writelines(" 'dockerManager',\n")
|
writeToFile.writelines(" 'dockerManager',\n")
|
||||||
|
|
||||||
|
if containerization == 1:
|
||||||
|
writeToFile.writelines(" 'containerization',\n")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
writeToFile.writelines(items)
|
writeToFile.writelines(items)
|
||||||
|
|
||||||
@@ -906,6 +1017,7 @@ WantedBy=multi-user.target"""
|
|||||||
|
|
||||||
Upgrade.applyLoginSystemMigrations()
|
Upgrade.applyLoginSystemMigrations()
|
||||||
Upgrade.s3BackupMigrations()
|
Upgrade.s3BackupMigrations()
|
||||||
|
Upgrade.containerMigrations()
|
||||||
Upgrade.enableServices()
|
Upgrade.enableServices()
|
||||||
|
|
||||||
Upgrade.installPHP73()
|
Upgrade.installPHP73()
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ try:
|
|||||||
import threading as multi
|
import threading as multi
|
||||||
from plogical.mailUtilities import mailUtilities
|
from plogical.mailUtilities import mailUtilities
|
||||||
import boto3
|
import boto3
|
||||||
from minio.error import ResponseError
|
|
||||||
from boto3.s3.transfer import TransferConfig
|
from boto3.s3.transfer import TransferConfig
|
||||||
import json
|
import json
|
||||||
from .models import *
|
from .models import *
|
||||||
@@ -148,6 +147,17 @@ class S3Backups(multi.Thread):
|
|||||||
proc = httpProc(self.request, None, None)
|
proc = httpProc(self.request, None, None)
|
||||||
return proc.ajax(0, str(msg))
|
return proc.ajax(0, str(msg))
|
||||||
|
|
||||||
|
def fetchAWSKeys(self):
|
||||||
|
path = '/home/cyberpanel/.aws'
|
||||||
|
credentials = path + '/credentials'
|
||||||
|
|
||||||
|
data = open(credentials, 'r').readlines()
|
||||||
|
|
||||||
|
aws_access_key_id = data[1].split(' ')[2].strip(' ').strip('\n')
|
||||||
|
aws_secret_access_key = data[2].split(' ')[2].strip(' ').strip('\n')
|
||||||
|
|
||||||
|
return aws_access_key_id, aws_secret_access_key
|
||||||
|
|
||||||
def fetchBuckets(self):
|
def fetchBuckets(self):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
@@ -159,7 +169,15 @@ class S3Backups(multi.Thread):
|
|||||||
if currentACL['admin'] == 0:
|
if currentACL['admin'] == 0:
|
||||||
return proc.ajax(0, 'Only administrators can use AWS S3 Backups.')
|
return proc.ajax(0, 'Only administrators can use AWS S3 Backups.')
|
||||||
|
|
||||||
s3 = boto3.resource('s3')
|
|
||||||
|
aws_access_key_id, aws_secret_access_key = self.fetchAWSKeys()
|
||||||
|
|
||||||
|
s3 = boto3.resource(
|
||||||
|
's3',
|
||||||
|
aws_access_key_id = aws_access_key_id,
|
||||||
|
aws_secret_access_key = aws_secret_access_key
|
||||||
|
)
|
||||||
|
|
||||||
json_data = "["
|
json_data = "["
|
||||||
checker = 0
|
checker = 0
|
||||||
|
|
||||||
@@ -404,7 +422,16 @@ class S3Backups(multi.Thread):
|
|||||||
plan = BackupPlan.objects.get(name=self.data['planName'])
|
plan = BackupPlan.objects.get(name=self.data['planName'])
|
||||||
bucketName = plan.bucket.strip('\n').strip(' ')
|
bucketName = plan.bucket.strip('\n').strip(' ')
|
||||||
runTime = time.strftime("%d:%m:%Y")
|
runTime = time.strftime("%d:%m:%Y")
|
||||||
client = boto3.client('s3')
|
|
||||||
|
aws_access_key_id, aws_secret_access_key = self.fetchAWSKeys()
|
||||||
|
|
||||||
|
client = boto3.client(
|
||||||
|
's3',
|
||||||
|
aws_access_key_id = aws_access_key_id,
|
||||||
|
aws_secret_access_key = aws_secret_access_key
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
config = TransferConfig(multipart_threshold=1024 * 25, max_concurrency=10,
|
config = TransferConfig(multipart_threshold=1024 * 25, max_concurrency=10,
|
||||||
multipart_chunksize=1024 * 25, use_threads=True)
|
multipart_chunksize=1024 * 25, use_threads=True)
|
||||||
|
|
||||||
|
|||||||
@@ -41,17 +41,17 @@ init()
|
|||||||
PHP_SUEXEC=2
|
PHP_SUEXEC=2
|
||||||
|
|
||||||
WS_USER=nobody
|
WS_USER=nobody
|
||||||
WS_GROUP=nogroup
|
WS_GROUP=nobody
|
||||||
|
|
||||||
DIR_OWN="nobody:nobody"
|
DIR_OWN="nobody:nobody"
|
||||||
CONF_OWN="nobody:nobody"
|
CONF_OWN="nobody:nobody"
|
||||||
|
|
||||||
BUILD_ROOT="$LSWS_HOME/../../../"
|
BUILD_ROOT="$LSWS_HOME/../../../"
|
||||||
WHM_CGIDIR="$BUILD_ROOT/usr/local/cpanel/whostmgr/docroot/cgi"
|
WHM_CGIDIR="$BUILD_ROOT/usr/local/cpanel/whostmgr/docroot/cgi"
|
||||||
if [ -d "$WHM_CGIDIR" ] ; then
|
if [ -d "$WHM_CGIDIR" ] ; then
|
||||||
HOST_PANEL="cpanel"
|
HOST_PANEL="cpanel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
license()
|
license()
|
||||||
@@ -59,14 +59,14 @@ license()
|
|||||||
SUCC=0
|
SUCC=0
|
||||||
TRY=1
|
TRY=1
|
||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
printf "%s" "Do you agree with above license? "
|
printf "%s" "Do you agree with above license? "
|
||||||
YES_NO='Yes'
|
YES_NO='Yes'
|
||||||
if [ "x$YES_NO" != "xYes" ]; then
|
if [ "x$YES_NO" != "xYes" ]; then
|
||||||
if [ $TRY -lt 3 ]; then
|
if [ $TRY -lt 3 ]; then
|
||||||
echo "Sorry, wrong answer! Type 'Yes' with capital 'Y', try again!"
|
echo "Sorry, wrong answer! Type 'Yes' with capital 'Y', try again!"
|
||||||
TRY=`expr $TRY + 1`
|
TRY=`expr $TRY + 1`
|
||||||
else
|
else
|
||||||
echo "Abort installation!"
|
echo "Abort installation!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -114,11 +114,11 @@ install_dir()
|
|||||||
DEST_RECOM="/opt/lsws"
|
DEST_RECOM="/opt/lsws"
|
||||||
fi
|
fi
|
||||||
WS_USER="nobody"
|
WS_USER="nobody"
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
As you are not the 'root' user, you may not be able to install the
|
As you are not the 'root' user, you may not be able to install the
|
||||||
web server into a system directory or enable chroot, the web server
|
web server into a system directory or enable chroot, the web server
|
||||||
process will run on behalf of current user - '$INST_USER'.
|
process will run on behalf of current user - '$INST_USER'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -131,8 +131,8 @@ EOF
|
|||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Please specify the destination directory. You must have permissions to
|
Please specify the destination directory. You must have permissions to
|
||||||
create and manage the directory. It is recommended to install the web server
|
create and manage the directory. It is recommended to install the web server
|
||||||
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
|
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
|
||||||
|
|
||||||
ATTENTION: The user '$WS_USER' must be able to access the destination
|
ATTENTION: The user '$WS_USER' must be able to access the destination
|
||||||
@@ -145,7 +145,7 @@ EOF
|
|||||||
if [ "x$TMP_DEST" = "x" ]; then
|
if [ "x$TMP_DEST" = "x" ]; then
|
||||||
TMP_DEST=$DEST_RECOM
|
TMP_DEST=$DEST_RECOM
|
||||||
fi
|
fi
|
||||||
if [ `expr "$TMP_DEST" : '~'` -gt 0 ]; then
|
if [ `expr "$TMP_DEST" : '~'` -gt 0 ]; then
|
||||||
LSWS_HOME="$HOME`echo $TMP_DEST | sed 's/^~//' `"
|
LSWS_HOME="$HOME`echo $TMP_DEST | sed 's/^~//' `"
|
||||||
else
|
else
|
||||||
LSWS_HOME=$TMP_DEST
|
LSWS_HOME=$TMP_DEST
|
||||||
@@ -164,11 +164,11 @@ EOF
|
|||||||
if [ -f "$LSWS_HOME/conf/httpd_config.xml" ]; then
|
if [ -f "$LSWS_HOME/conf/httpd_config.xml" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Found old configuration file under destination directory $LSWS_HOME.
|
Found old configuration file under destination directory $LSWS_HOME.
|
||||||
|
|
||||||
To upgrade, press 'Enter', current configuration will not be changed.
|
To upgrade, press 'Enter', current configuration will not be changed.
|
||||||
To reinstall, press 'R' or 'r'.
|
To reinstall, press 'R' or 'r'.
|
||||||
To change directory, press 'C' or 'c'.
|
To change directory, press 'C' or 'c'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -178,15 +178,15 @@ EOF
|
|||||||
if [ "x$TMP_URC" = "x" ]; then
|
if [ "x$TMP_URC" = "x" ]; then
|
||||||
INSTALL_TYPE="upgrade"
|
INSTALL_TYPE="upgrade"
|
||||||
SET_LOGIN=0
|
SET_LOGIN=0
|
||||||
else
|
else
|
||||||
if [ `expr "$TMP_URC" : '[Uu]'` -gt 0 ]; then
|
if [ `expr "$TMP_URC" : '[Uu]'` -gt 0 ]; then
|
||||||
INSTALL_TYPE="upgrade"
|
INSTALL_TYPE="upgrade"
|
||||||
SET_LOGIN=0
|
SET_LOGIN=0
|
||||||
else
|
else
|
||||||
if [ `expr "$TMP_URC" : '[Rr]'` -gt 0 ]; then
|
if [ `expr "$TMP_URC" : '[Rr]'` -gt 0 ]; then
|
||||||
INSTALL_TYPE="reinstall"
|
INSTALL_TYPE="reinstall"
|
||||||
SET_LOGIN=1
|
SET_LOGIN=1
|
||||||
else
|
else
|
||||||
#if [ `expr "$TMP_URC" : '[Cc]'` -gt 0 ]; then
|
#if [ `expr "$TMP_URC" : '[Cc]'` -gt 0 ]; then
|
||||||
SUCC=0
|
SUCC=0
|
||||||
fi
|
fi
|
||||||
@@ -224,7 +224,7 @@ admin_login()
|
|||||||
SET_LOGIN=1
|
SET_LOGIN=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $SET_LOGIN -eq 1 ]; then
|
if [ $SET_LOGIN -eq 1 ]; then
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ a non-system user who does not have login shell and home directory such as
|
|||||||
'nobody'.
|
'nobody'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
# get user name
|
# get user name
|
||||||
SUCC=0
|
SUCC=0
|
||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
printf "%s" "User [$WS_USER]: "
|
printf "%s" "User [$WS_USER]: "
|
||||||
@@ -312,22 +312,22 @@ EOF
|
|||||||
TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
|
TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
|
||||||
if [ "x$TST_USER" = "x$TMP_USER" ]; then
|
if [ "x$TST_USER" = "x$TMP_USER" ]; then
|
||||||
USER_ID=`expr "$USER_INFO" : 'uid=\(.*\)(.*) gid=.*'`
|
USER_ID=`expr "$USER_INFO" : 'uid=\(.*\)(.*) gid=.*'`
|
||||||
if [ $USER_ID -gt 10 ]; then
|
if [ $USER_ID -gt 10 ]; then
|
||||||
WS_USER=$TMP_USER
|
WS_USER=$TMP_USER
|
||||||
SUCC=1
|
SUCC=1
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
[ERROR] It is not allowed to run LiteSpeed web server on behalf of a
|
[ERROR] It is not allowed to run LiteSpeed web server on behalf of a
|
||||||
privileged user, user id must be greater than 10. The user id of user
|
privileged user, user id must be greater than 10. The user id of user
|
||||||
'$TMP_USER' is '$USER_ID'.
|
'$TMP_USER' is '$USER_ID'.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
[ERROR] '$TMP_USER' is not valid user name in your system, please choose
|
[ERROR] '$TMP_USER' is not valid user name in your system, please choose
|
||||||
another user or create user '$TMP_USER' first.
|
another user or create user '$TMP_USER' first.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -336,7 +336,7 @@ EOF
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get group name
|
# get group name
|
||||||
SUCC=0
|
SUCC=0
|
||||||
TMP_GROUPS=`groups $WS_USER`
|
TMP_GROUPS=`groups $WS_USER`
|
||||||
TST_GROUPS=`expr "$TMP_GROUPS" : '.*:\(.*\)'`
|
TST_GROUPS=`expr "$TMP_GROUPS" : '.*:\(.*\)'`
|
||||||
@@ -347,7 +347,7 @@ EOF
|
|||||||
D_GROUP=`$ID_GROUPS $WS_USER`
|
D_GROUP=`$ID_GROUPS $WS_USER`
|
||||||
D_GROUP=`expr "$D_GROUP" : '.*gid=[0-9]*(\(.*\)) groups=.*'`
|
D_GROUP=`expr "$D_GROUP" : '.*gid=[0-9]*(\(.*\)) groups=.*'`
|
||||||
echo "Please choose the group that the web server running as."
|
echo "Please choose the group that the web server running as."
|
||||||
echo
|
echo
|
||||||
while [ $SUCC -eq "0" ]; do
|
while [ $SUCC -eq "0" ]; do
|
||||||
echo "User '$WS_USER' is the member of following group(s): $TST_GROUPS"
|
echo "User '$WS_USER' is the member of following group(s): $TST_GROUPS"
|
||||||
printf "%s" "Group [$D_GROUP]: "
|
printf "%s" "Group [$D_GROUP]: "
|
||||||
@@ -363,7 +363,7 @@ EOF
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
[ERROR] '$TMP_GROUP' is not valid group for user '$WS_USER', please choose
|
[ERROR] '$TMP_GROUP' is not valid group for user '$WS_USER', please choose
|
||||||
another group in the list or add user '$WS_USER' to group '$TMP_GROUP'
|
another group in the list or add user '$WS_USER' to group '$TMP_GROUP'
|
||||||
first.
|
first.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -385,7 +385,7 @@ stopLshttpd()
|
|||||||
RUNNING_PROCESS=`$PS_CMD | grep lshttpd | grep -v grep`
|
RUNNING_PROCESS=`$PS_CMD | grep lshttpd | grep -v grep`
|
||||||
if [ "x$RUNNING_PROCESS" != "x" ]; then
|
if [ "x$RUNNING_PROCESS" != "x" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
LiteSpeed web server is running, in order to continue installation, the server
|
LiteSpeed web server is running, in order to continue installation, the server
|
||||||
must be stopped.
|
must be stopped.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -415,7 +415,7 @@ getServerPort()
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Please specify the port for normal HTTP service.
|
Please specify the port for normal HTTP service.
|
||||||
Port 80 is the standard HTTP port, only 'root' user is allowed to use
|
Port 80 is the standard HTTP port, only 'root' user is allowed to use
|
||||||
port 80, if you have another web server running on port 80, you need to
|
port 80, if you have another web server running on port 80, you need to
|
||||||
specify another port or stop the other web server before starting LiteSpeed
|
specify another port or stop the other web server before starting LiteSpeed
|
||||||
Web Server.
|
Web Server.
|
||||||
@@ -513,9 +513,9 @@ configAdminEmail()
|
|||||||
|
|
||||||
Please specify administrators' email addresses.
|
Please specify administrators' email addresses.
|
||||||
It is recommended to specify a real email address,
|
It is recommended to specify a real email address,
|
||||||
Multiple email addresses can be set by a comma
|
Multiple email addresses can be set by a comma
|
||||||
delimited list of email addresses. Whenever something
|
delimited list of email addresses. Whenever something
|
||||||
abnormal happened, a notificiation will be sent to
|
abnormal happened, a notificiation will be sent to
|
||||||
emails listed here.
|
emails listed here.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -550,9 +550,9 @@ enablePHPHandler()
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
You can setup a global script handler for PHP with the pre-built PHP engine
|
You can setup a global script handler for PHP with the pre-built PHP engine
|
||||||
shipped with this package now. The PHP engine runs as Fast CGI which
|
shipped with this package now. The PHP engine runs as Fast CGI which
|
||||||
outperforms Apache's mod_php.
|
outperforms Apache's mod_php.
|
||||||
You can always replace the pre-built PHP engine with your customized PHP
|
You can always replace the pre-built PHP engine with your customized PHP
|
||||||
engine.
|
engine.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -568,7 +568,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
if [ $SETUP_PHP -eq 1 ]; then
|
if [ $SETUP_PHP -eq 1 ]; then
|
||||||
PHP_SUFFIX="php"
|
PHP_SUFFIX="php"
|
||||||
printf "%s" "Suffix for PHP script(comma separated list) [$PHP_SUFFIX]: "
|
printf "%s" "Suffix for PHP script(comma separated list) [$PHP_SUFFIX]: "
|
||||||
TMP_SUFFIX='php'
|
TMP_SUFFIX='php'
|
||||||
if [ "x$TMP_SUFFIX" != "x" ]; then
|
if [ "x$TMP_SUFFIX" != "x" ]; then
|
||||||
PHP_SUFFIX=$TMP_SUFFIX
|
PHP_SUFFIX=$TMP_SUFFIX
|
||||||
@@ -677,7 +677,7 @@ util_mkdir()
|
|||||||
chown "$OWNER" "$LSWS_HOME/$arg"
|
chown "$OWNER" "$LSWS_HOME/$arg"
|
||||||
chmod $PERM "$LSWS_HOME/$arg"
|
chmod $PERM "$LSWS_HOME/$arg"
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -693,7 +693,7 @@ util_cpfile()
|
|||||||
chown "$OWNER" "$LSWS_HOME/$arg"
|
chown "$OWNER" "$LSWS_HOME/$arg"
|
||||||
chmod $PERM "$LSWS_HOME/$arg"
|
chmod $PERM "$LSWS_HOME/$arg"
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
util_ccpfile()
|
util_ccpfile()
|
||||||
@@ -883,31 +883,31 @@ create_lsadm_freebsd()
|
|||||||
{
|
{
|
||||||
pw group add lsadm
|
pw group add lsadm
|
||||||
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
||||||
pw user add -g $lsadm_gid -d / -s /usr/sbin/nologin -n lsadm
|
pw user add -g $lsadm_gid -d / -s /usr/sbin/nologin -n lsadm
|
||||||
pw usermod lsadm -G $WS_GROUP
|
pw usermod lsadm -G $WS_GROUP
|
||||||
}
|
}
|
||||||
|
|
||||||
create_lsadm()
|
create_lsadm()
|
||||||
{
|
{
|
||||||
groupadd lsadm
|
groupadd lsadm
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
|
||||||
useradd -g $lsadm_gid -d / -r -s /sbin/nologin lsadm
|
useradd -g $lsadm_gid -d / -r -s /sbin/nologin lsadm
|
||||||
usermod -a -G $WS_GROUP lsadm
|
usermod -a -G $WS_GROUP lsadm
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create_lsadm_solaris()
|
create_lsadm_solaris()
|
||||||
{
|
{
|
||||||
groupadd lsadm
|
groupadd lsadm
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F: '{ print $3; }'`
|
lsadm_gid=`grep "^lsadm:" /etc/group | awk -F: '{ print $3; }'`
|
||||||
useradd -g $lsadm_gid -d / -s /bin/false lsadm
|
useradd -g $lsadm_gid -d / -s /bin/false lsadm
|
||||||
usermod -G $WS_GROUP lsadm
|
usermod -G $WS_GROUP lsadm
|
||||||
|
|
||||||
#1>/dev/null 2>&1
|
#1>/dev/null 2>&1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -946,7 +946,7 @@ installation()
|
|||||||
create_lsadm_freebsd
|
create_lsadm_freebsd
|
||||||
elif [ "x$SYS_NAME" = "xSunOS" ]; then
|
elif [ "x$SYS_NAME" = "xSunOS" ]; then
|
||||||
create_lsadm_solaris
|
create_lsadm_solaris
|
||||||
fi
|
fi
|
||||||
grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1
|
grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
CONF_OWN="lsadm:lsadm"
|
CONF_OWN="lsadm:lsadm"
|
||||||
@@ -959,33 +959,33 @@ installation()
|
|||||||
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc"
|
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc"
|
||||||
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo"
|
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo"
|
||||||
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lshttpd.service.in" > "$LSINSTALL_DIR/admin/misc/lshttpd.service"
|
sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lshttpd.service.in" > "$LSINSTALL_DIR/admin/misc/lshttpd.service"
|
||||||
|
|
||||||
if [ -d "$LSWS_HOME/admin/html.$VERSION" ]; then
|
if [ -d "$LSWS_HOME/admin/html.$VERSION" ]; then
|
||||||
rm -rf "$LSWS_HOME/admin/html.$VERSION"
|
rm -rf "$LSWS_HOME/admin/html.$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD admin bin docs fcgi-bin lib logs admin/logs add-ons share admin/fcgi-bin
|
util_mkdir "$SDIR_OWN" $DIR_MOD admin bin docs fcgi-bin lib logs admin/logs add-ons share admin/fcgi-bin
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD admin/html.$VERSION admin/misc
|
util_mkdir "$SDIR_OWN" $DIR_MOD admin/html.$VERSION admin/misc
|
||||||
util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates admin/conf admin/conf/cert admin/tmp phpbuild autoupdate
|
util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates admin/conf admin/conf/cert admin/tmp phpbuild autoupdate
|
||||||
util_mkdir "$SDIR_OWN" $SDIR_MOD admin/cgid admin/cgid/secret
|
util_mkdir "$SDIR_OWN" $SDIR_MOD admin/cgid admin/cgid/secret
|
||||||
util_mkdir "$CONF_OWN" $DIR_MOD admin/htpasswds
|
util_mkdir "$CONF_OWN" $DIR_MOD admin/htpasswds
|
||||||
chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
||||||
chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
|
||||||
chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1
|
chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT
|
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT
|
||||||
|
|
||||||
buildAdminSslCert
|
buildAdminSslCert
|
||||||
|
|
||||||
find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null
|
find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
find "$LSWS_HOME/admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f
|
find "$LSWS_HOME/admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find "/tmp/lshttpd" -type s -atime +1 -delete 2>/dev/null
|
find "/tmp/lshttpd" -type s -atime +1 -delete 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
find "/tmp/lshttpd" -type s -atime +1 2>/dev/null | xargs rm -f
|
find "/tmp/lshttpd" -type s -atime +1 2>/dev/null | xargs rm -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$HOST_PANEL" = "xcpanel" ]; then
|
if [ "x$HOST_PANEL" = "xcpanel" ]; then
|
||||||
if [ ! -d "$BUILD_ROOT/usr/local/lib/php/autoindex/" ]; then
|
if [ ! -d "$BUILD_ROOT/usr/local/lib/php/autoindex/" ]; then
|
||||||
@@ -1012,21 +1012,21 @@ installation()
|
|||||||
fi
|
fi
|
||||||
util_cpdir "$SDIR_OWN" $DOC_MOD add-ons
|
util_cpdir "$SDIR_OWN" $DOC_MOD add-ons
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD add-ons/modsec/inspectmulti.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD add-ons/modsec/inspectmulti.sh
|
||||||
|
|
||||||
util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl
|
util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RackRunner.rb fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3
|
util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RackRunner.rb fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/fcgi-bin/admin_php5
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/fcgi-bin/admin_php5
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/rc-inst.sh admin/misc/admpass.sh admin/misc/rc-uninst.sh admin/misc/uninstall.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/rc-inst.sh admin/misc/admpass.sh admin/misc/rc-uninst.sh admin/misc/uninstall.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lsws.rc admin/misc/lshttpd.service admin/misc/lsws.rc.gentoo admin/misc/enable_ruby_python_selector.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lsws.rc admin/misc/lshttpd.service admin/misc/lsws.rc.gentoo admin/misc/enable_ruby_python_selector.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/mgr_ver.sh admin/misc/gzipStatic.sh admin/misc/fp_install.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/mgr_ver.sh admin/misc/gzipStatic.sh admin/misc/fp_install.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/create_admin_keypair.sh admin/misc/awstats_install.sh admin/misc/update.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/create_admin_keypair.sh admin/misc/awstats_install.sh admin/misc/update.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/cleancache.sh admin/misc/cleanlitemage.sh admin/misc/lsup5.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/cleancache.sh admin/misc/cleanlitemage.sh admin/misc/lsup5.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/fix_cagefs.sh admin/misc/cp_switch_ws.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/fix_cagefs.sh admin/misc/cp_switch_ws.sh
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lscmctl
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lscmctl
|
||||||
ln -sf ./lsup5.sh "$LSWS_HOME/admin/misc/lsup.sh"
|
ln -sf ./lsup5.sh "$LSWS_HOME/admin/misc/lsup.sh"
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/ap_lsws.sh.in admin/misc/build_ap_wrapper.sh admin/misc/cpanel_restart_httpd.in
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/ap_lsws.sh.in admin/misc/build_ap_wrapper.sh admin/misc/cpanel_restart_httpd.in
|
||||||
util_cpfile "$SDIR_OWN" $DOC_MOD admin/misc/gdb-bt admin/misc/htpasswd.php admin/misc/php.ini admin/misc/genjCryptionKeyPair.php admin/misc/purge_cache_byurl.php
|
util_cpfile "$SDIR_OWN" $DOC_MOD admin/misc/gdb-bt admin/misc/htpasswd.php admin/misc/php.ini admin/misc/genjCryptionKeyPair.php admin/misc/purge_cache_byurl.php
|
||||||
|
|
||||||
if [ -f "$LSINSTALL_DIR/admin/misc/chroot.sh" ]; then
|
if [ -f "$LSINSTALL_DIR/admin/misc/chroot.sh" ]; then
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh
|
||||||
fi
|
fi
|
||||||
@@ -1043,7 +1043,7 @@ installation()
|
|||||||
chown $CONF_OWN "$LSWS_HOME/admin/htpasswds/status"
|
chown $CONF_OWN "$LSWS_HOME/admin/htpasswds/status"
|
||||||
chgrp $WS_GROUP "$LSWS_HOME/admin/htpasswds/status"
|
chgrp $WS_GROUP "$LSWS_HOME/admin/htpasswds/status"
|
||||||
chmod 0640 "$LSWS_HOME/admin/htpasswds/status"
|
chmod 0640 "$LSWS_HOME/admin/htpasswds/status"
|
||||||
|
|
||||||
if [ $INSTALL_TYPE = "upgrade" ]; then
|
if [ $INSTALL_TYPE = "upgrade" ]; then
|
||||||
util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml
|
util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml
|
||||||
util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini
|
util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini
|
||||||
@@ -1067,7 +1067,7 @@ installation()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$LSWS_HOME/DEFAULT/conf/vhconf.xml" ]; then
|
if [ ! -f "$LSWS_HOME/DEFAULT/conf/vhconf.xml" ]; then
|
||||||
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
||||||
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -1077,7 +1077,7 @@ installation()
|
|||||||
util_cpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties
|
util_cpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties
|
||||||
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
|
||||||
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT/html DEFAULT/cgi-bin
|
util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT/html DEFAULT/cgi-bin
|
||||||
util_cpdir "$SDIR_OWN" $DOC_MOD DEFAULT/html DEFAULT/cgi-bin
|
util_cpdir "$SDIR_OWN" $DOC_MOD DEFAULT/html DEFAULT/cgi-bin
|
||||||
fi
|
fi
|
||||||
if [ $SETUP_PHP -eq 1 ]; then
|
if [ $SETUP_PHP -eq 1 ]; then
|
||||||
@@ -1110,26 +1110,26 @@ installation()
|
|||||||
|
|
||||||
|
|
||||||
util_cpfile "$SDIR_OWN" $EXEC_MOD bin/wswatch.sh
|
util_cpfile "$SDIR_OWN" $EXEC_MOD bin/wswatch.sh
|
||||||
util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lswsctrl bin/lshttpd bin/lscgid
|
util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lswsctrl bin/lshttpd bin/lscgid
|
||||||
|
|
||||||
$TEST_BIN ! -L "$LSWS_HOME/modules"
|
$TEST_BIN ! -L "$LSWS_HOME/modules"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
mv -f "$LSWS_HOME/modules" "$LSWS_HOME/modules.old"
|
mv -f "$LSWS_HOME/modules" "$LSWS_HOME/modules.old"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "$LSWS_HOME/modules.$VERSION" ]; then
|
if [ -d "$LSWS_HOME/modules.$VERSION" ]; then
|
||||||
rm -rf "$LSWS_HOME/modules.$VERSION"
|
rm -rf "$LSWS_HOME/modules.$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
util_mkdir "$SDIR_OWN" $DIR_MOD modules.$VERSION
|
util_mkdir "$SDIR_OWN" $DIR_MOD modules.$VERSION
|
||||||
util_cpdirv "$SDIR_OWN" $EXEC_MOD $VERSION modules
|
util_cpdirv "$SDIR_OWN" $EXEC_MOD $VERSION modules
|
||||||
|
|
||||||
#if [ -e "$LSINSTALL_DIR/bin/lshttpd.dbg" ]; then
|
#if [ -e "$LSINSTALL_DIR/bin/lshttpd.dbg" ]; then
|
||||||
# if [ -f "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION" ]; then
|
# if [ -f "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION" ]; then
|
||||||
# rm "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION"
|
# rm "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION"
|
||||||
# fi
|
# fi
|
||||||
# util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lshttpd.dbg
|
# util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lshttpd.dbg
|
||||||
#
|
#
|
||||||
# #enable debug build for beta release
|
# #enable debug build for beta release
|
||||||
# ln -sf ./lshttpd.dbg.$VERSION $LSWS_HOME/bin/lshttpd
|
# ln -sf ./lshttpd.dbg.$VERSION $LSWS_HOME/bin/lshttpd
|
||||||
#fi
|
#fi
|
||||||
@@ -1141,10 +1141,10 @@ installation()
|
|||||||
if [ $INST_USER = "root" ]; then
|
if [ $INST_USER = "root" ]; then
|
||||||
chmod u+s "$LSWS_HOME/bin/lscgid.$VERSION"
|
chmod u+s "$LSWS_HOME/bin/lscgid.$VERSION"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
util_cpdir "$SDIR_OWN" $DOC_MOD docs/
|
util_cpdir "$SDIR_OWN" $DOC_MOD docs/
|
||||||
util_cpfile "$SDIR_OWN" $DOC_MOD VERSION BUILD LICENSE*
|
util_cpfile "$SDIR_OWN" $DOC_MOD VERSION BUILD LICENSE*
|
||||||
|
|
||||||
if [ -f $LSWS_HOME/autoupdate/download ]; then
|
if [ -f $LSWS_HOME/autoupdate/download ]; then
|
||||||
rm $LSWS_HOME/autoupdate/download
|
rm $LSWS_HOME/autoupdate/download
|
||||||
@@ -1158,12 +1158,12 @@ installation()
|
|||||||
chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair"
|
chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair"
|
||||||
chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair"
|
chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair"
|
||||||
|
|
||||||
fix_cloudlinux
|
fix_cloudlinux
|
||||||
|
|
||||||
if [ $INST_USER = "root" ]; then
|
if [ $INST_USER = "root" ]; then
|
||||||
$LSWS_HOME/admin/misc/rc-inst.sh
|
$LSWS_HOME/admin/misc/rc-inst.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1179,7 +1179,7 @@ PHP scripts by caching them in compiled state, the overhead of compiling
|
|||||||
PHP is avoided.
|
PHP is avoided.
|
||||||
|
|
||||||
Note: If an opcode cache has been installed already, you do not need to
|
Note: If an opcode cache has been installed already, you do not need to
|
||||||
change it. If you need to built PHP binary by yourself, you need to
|
change it. If you need to built PHP binary by yourself, you need to
|
||||||
built PHP opcode cache from source as well, unless the version of your
|
built PHP opcode cache from source as well, unless the version of your
|
||||||
PHP binary is same as that the pre-built PHP opcode cache built for.
|
PHP binary is same as that the pre-built PHP opcode cache built for.
|
||||||
|
|
||||||
@@ -1205,8 +1205,8 @@ installAWStats()
|
|||||||
|
|
||||||
AWStats Integration
|
AWStats Integration
|
||||||
|
|
||||||
AWStats is a popular log analyzer that generates advanced web server
|
AWStats is a popular log analyzer that generates advanced web server
|
||||||
statistics. LiteSpeed web server seamlessly integrates AWStats into
|
statistics. LiteSpeed web server seamlessly integrates AWStats into
|
||||||
its Web Admin Interface. AWStats configuration and statistics update
|
its Web Admin Interface. AWStats configuration and statistics update
|
||||||
have been taken care of by LiteSpeed web server.
|
have been taken care of by LiteSpeed web server.
|
||||||
|
|
||||||
@@ -1238,23 +1238,23 @@ Congratulations! The LiteSpeed Web Server has been successfully installed.
|
|||||||
Command line script - "$LSWS_HOME/bin/lswsctrl"
|
Command line script - "$LSWS_HOME/bin/lswsctrl"
|
||||||
can be used to start or stop the server.
|
can be used to start or stop the server.
|
||||||
|
|
||||||
It is recommended to limit access to the web administration interface.
|
It is recommended to limit access to the web administration interface.
|
||||||
Right now the interface can be accessed from anywhere where this
|
Right now the interface can be accessed from anywhere where this
|
||||||
machine can be reached over the network.
|
machine can be reached over the network.
|
||||||
|
|
||||||
Three options are available:
|
Three options are available:
|
||||||
1. If the interface needs to be accessed only from this machine, just
|
1. If the interface needs to be accessed only from this machine, just
|
||||||
change the listener for the interface to only listen on the loopback
|
change the listener for the interface to only listen on the loopback
|
||||||
interface - localhost(127.0.0.1).
|
interface - localhost(127.0.0.1).
|
||||||
2. If the interface needs to be accessible from limited IP addresses or sub
|
2. If the interface needs to be accessible from limited IP addresses or sub
|
||||||
networks, then set up access control rules for the interface accordingly.
|
networks, then set up access control rules for the interface accordingly.
|
||||||
3. If the interface has to be accessible via internet, SSL (Secure Sockets
|
3. If the interface has to be accessible via internet, SSL (Secure Sockets
|
||||||
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
|
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
|
||||||
|
|
||||||
To change configurations of the interface, login and click
|
To change configurations of the interface, login and click
|
||||||
"Interface Configuration" button on the main page.
|
"Interface Configuration" button on the main page.
|
||||||
The administration interface is located at http://localhost:<ADMIN_PORT>/
|
The administration interface is located at http://localhost:<ADMIN_PORT>/
|
||||||
or http://<ip_or_Hostname_of_this_machine>:<ADMIN_PORT>/
|
or http://<ip_or_Hostname_of_this_machine>:<ADMIN_PORT>/
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -1262,7 +1262,7 @@ EOF
|
|||||||
if [ $INSTALL_TYPE != "upgrade" ]; then
|
if [ $INSTALL_TYPE != "upgrade" ]; then
|
||||||
printf "%s\n%s" "Would you like to have LiteSpeed Web Server started automatically" "when the server restarts [Y/n]? "
|
printf "%s\n%s" "Would you like to have LiteSpeed Web Server started automatically" "when the server restarts [Y/n]? "
|
||||||
START_SERVER='y'
|
START_SERVER='y'
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ "x$START_SERVER" = "x" ]; then
|
if [ "x$START_SERVER" = "x" ]; then
|
||||||
START_SERVER=y
|
START_SERVER=y
|
||||||
@@ -1271,7 +1271,7 @@ EOF
|
|||||||
$LSWS_HOME/admin/misc/rc-inst.sh
|
$LSWS_HOME/admin/misc/rc-inst.sh
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
If you want to start the web server automatically later, just run
|
If you want to start the web server automatically later, just run
|
||||||
"$LSWS_HOME//rc-inst.sh"
|
"$LSWS_HOME//rc-inst.sh"
|
||||||
to install the service control script.
|
to install the service control script.
|
||||||
|
|
||||||
@@ -1279,12 +1279,12 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "x$HOST_PANEL" != "x" ]; then
|
if [ "x$HOST_PANEL" != "x" ]; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
The default configuration file contain support for both PHP4 and PHP5,
|
The default configuration file contain support for both PHP4 and PHP5,
|
||||||
A prebuilt PHP4 binary comes with this package, however, we recommend
|
A prebuilt PHP4 binary comes with this package, however, we recommend
|
||||||
you to build your own PHP4 and PHP5 binaries though our web console with
|
you to build your own PHP4 and PHP5 binaries though our web console with
|
||||||
the same configuration parameters as your current PHP installation. You
|
the same configuration parameters as your current PHP installation. You
|
||||||
can check your current PHP configuration via a phpinfo() page.
|
can check your current PHP configuration via a phpinfo() page.
|
||||||
|
|
||||||
Press [ENTER] to continue
|
Press [ENTER] to continue
|
||||||
@@ -1293,7 +1293,7 @@ EOF
|
|||||||
|
|
||||||
read TMP_VAL
|
read TMP_VAL
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
When you replace Apache with LiteSpeed, remember to stop Apache completely.
|
When you replace Apache with LiteSpeed, remember to stop Apache completely.
|
||||||
On most Linux servers, you should do:
|
On most Linux servers, you should do:
|
||||||
@@ -1323,7 +1323,7 @@ EOF
|
|||||||
printf "%s" "Would you like to restart it right now [Y/n]? "
|
printf "%s" "Would you like to restart it right now [Y/n]? "
|
||||||
fi
|
fi
|
||||||
START_SERVER='y'
|
START_SERVER='y'
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ "x$START_SERVER" = "x" ]; then
|
if [ "x$START_SERVER" = "x" ]; then
|
||||||
START_SERVER=y
|
START_SERVER=y
|
||||||
@@ -1361,4 +1361,3 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ EOF
|
|||||||
if [ $SEL -eq "1" ]; then
|
if [ $SEL -eq "1" ]; then
|
||||||
HOST_PANEL="cpanel"
|
HOST_PANEL="cpanel"
|
||||||
WS_USER=nobody
|
WS_USER=nobody
|
||||||
WS_GROUP=nogroup
|
WS_GROUP=nobody
|
||||||
if [ -e "/etc/cpanel/ea4/is_ea4" ] ; then
|
if [ -e "/etc/cpanel/ea4/is_ea4" ] ; then
|
||||||
PANEL_VARY=".ea4"
|
PANEL_VARY=".ea4"
|
||||||
fi
|
fi
|
||||||
@@ -473,13 +473,13 @@ fi
|
|||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Installing, please wait...
|
Installing, please wait...
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "x$HOST_PANEL" = "xdirectadmin" ]; then
|
if [ "x$HOST_PANEL" = "xdirectadmin" ]; then
|
||||||
chmod g+x /var/log/httpd/
|
chmod g+x /var/log/httpd/
|
||||||
chgrp apache /var/log/httpd/
|
chgrp apache /var/log/httpd/
|
||||||
chown apache:apache /var/log/httpd/domains
|
chown apache:apache /var/log/httpd/domains
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -503,4 +503,3 @@ fi
|
|||||||
|
|
||||||
finish
|
finish
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -234,9 +234,9 @@ app.controller('listWebsites', function ($scope, $http) {
|
|||||||
function ListInitialData(response) {
|
function ListInitialData(response) {
|
||||||
|
|
||||||
if (response.data.listWebSiteStatus === 1) {
|
if (response.data.listWebSiteStatus === 1) {
|
||||||
|
|
||||||
var finalData = JSON.parse(response.data.data);
|
var finalData = JSON.parse(response.data.data);
|
||||||
$scope.WebSitesList = finalData;
|
$scope.WebSitesList = finalData;
|
||||||
|
$scope.pagination = response.data.pagination;
|
||||||
$("#listFail").hide();
|
$("#listFail").hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -234,9 +234,9 @@ app.controller('listWebsites', function ($scope, $http) {
|
|||||||
function ListInitialData(response) {
|
function ListInitialData(response) {
|
||||||
|
|
||||||
if (response.data.listWebSiteStatus === 1) {
|
if (response.data.listWebSiteStatus === 1) {
|
||||||
|
|
||||||
var finalData = JSON.parse(response.data.data);
|
var finalData = JSON.parse(response.data.data);
|
||||||
$scope.WebSitesList = finalData;
|
$scope.WebSitesList = finalData;
|
||||||
|
$scope.pagination = response.data.pagination;
|
||||||
$("#listFail").hide();
|
$("#listFail").hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -21,8 +21,6 @@
|
|||||||
src="{% static 'images/loading.gif' %}">
|
src="{% static 'images/loading.gif' %}">
|
||||||
</h3>
|
</h3>
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
|
||||||
<form name="websiteCreationForm" action="/" id="createPackages"
|
<form name="websiteCreationForm" action="/" id="createPackages"
|
||||||
class="form-horizontal bordered-row">
|
class="form-horizontal bordered-row">
|
||||||
|
|
||||||
@@ -165,7 +163,6 @@
|
|||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user