PDA

View Full Version : how to restart ispc3 service


radim_h
23rd March 2009, 15:35
Hello guys,

i have simple question, how should i restart ispconfi3 service as there is nothing as /etc/init.d/ispc*

till
23rd March 2009, 22:57
ISPConfig 3 has no service, so you cant restart it and there is no ned to restart it.

Polk
24th March 2009, 07:07
In other words, what you need is to restart Apache2.

/etc/init.d/apache2 restart

that will restart all web applications on your server.

radim_h
24th March 2009, 20:53
thanks for explaining, guys .o)

HellMind
26th March 2009, 19:03
but this isn't 100% truth

I ve modified my .vhost from apache2

Restarted apache2 and works fine

But, if I reboot, ispc restore the .vhost file

Why?

till
26th March 2009, 19:05
1) Which ispconfig version?
2) Which vhsot file is restored?
3) What did you change in this vhost file?

HellMind
26th March 2009, 19:08
1) Which ispconfig version?
2) Which vhsot file is restored?
3) What did you change in this vhost file?

1
3.0.0.0 RC2 (I updated to .1 I will try again);
2
Any one that I modified /etc/apache2/sites-available/*.vhost
3
AllowOverride to all
and some fix of
rewrite redirects

till
26th March 2009, 19:13
1) Yes, please update to the ๖atest release.
2) ISPconfig 3 updates a site only when you change something in the ispconfig interface and not when the server is rebooted. You can verify that by enableing debugging in /usr/local/ispconfig/server/lib/config.inc.php and then check the monitoring module after a reboot. If ISPConfig updates your sites then there will be a lot of lines which describe the update process for every website in detail.
3) The vhosts files should never be modified manually. Either you edit the master template that is used to create the files or you add your modifications to the apache directives field of the website.

HellMind
26th March 2009, 19:23
3) The vhosts files should never be modified manually. Either you edit the master template that is used to create the files or you add your modifications to the apache directives field of the website.
-
1.- I need to fix a redirect problem, dunno why but one site add the rewrite directive to another file, :
If you add www redirect of a A domain
It changes the B.vhost file :S

Also I need to add "allowoveride all"

Where are the apaches directives to do this?

till
26th March 2009, 19:26
If you add www redirect of a A domain
It changes the B.vhost file :S

Not on my servers. Turn on debugging if you want to check this on your server, but I'am 100% sure that only the vhost is changed were the domain belongs to.

Where are the apaches directives to do this?

Last tab in the website settings.

HellMind
26th March 2009, 20:06
When I modified a.com.ar domain option it modifies the B one
I just added the www. redirection of a.com.ar, here is the log



2009-03-26 15:01 ispconfig Debug Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
2009-03-26 15:01 ispconfig Debug No Updated records found, starting only the core.
2009-03-26 15:01 ispconfig Debug Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
2009-03-26 15:01 ispconfig Debug Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
2009-03-26 15:01 ispconfig Debug Call function 'restartHttpd' in module 'web_module'.
2009-03-26 15:01 ispconfig Debug Processed datalog_id 609
2009-03-26 15:01 ispconfig Debug Writing the vhost file: /etc/apache2/sites-available/b.com.vhost
2009-03-26 15:01 ispconfig Debug Add server alias: a.com.ar
2009-03-26 15:01 ispconfig Debug Add server alias: b.com
2009-03-26 15:01 ispconfig Debug Disable SSL for: b.com
2009-03-26 15:01 ispconfig Debug Call function 'update' in plugin 'apache2_plugin' raised by event 'web_domain_update'.
2009-03-26 15:01 ispconfig Debug Call function 'ssl' in plugin 'apache2_plugin' raised by event 'web_domain_update'.
2009-03-26 15:01 ispconfig Debug There is already a lockfile set. Waiting another 10 seconds...
2009-03-26 15:01 ispconfig Debug There is already a lockfile set. Waiting another 10 seconds...
2009-03-26 15:00 ispconfig Debug Found 1 changes, starting update process.

till
26th March 2009, 20:09
Thats all pretty fine. You forgot to mention that a.com and b.com are not two independant websites. A.com is a alias or subdomain of b.com, so ISPconfig has to modify b.com as a aliases of vhostsvare defined in the same vhost file of course.

HellMind
26th March 2009, 20:32
Thats all pretty fine. You forgot to mention that a.com and b.com are not two independant websites. A.com is a alias or subdomain of b.com, so ISPconfig has to modify b.com as a aliases of vhostsvare defined in the same vhost file of course.

There was a problem there, I fixed it, but leave that.

Now the obvious problem is

The Auto-Subdomain www
Isn't work
It doesn't add the redirect rule to vhost file

2009-03-26 15:27 ispconfig Debug Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
2009-03-26 15:27 ispconfig Debug Call function 'restartHttpd' in module 'web_module'.
2009-03-26 15:27 ispconfig Debug Processed datalog_id 620
2009-03-26 15:27 ispconfig Debug Writing the vhost file: /etc/apache2/sites-available/a.vhost
2009-03-26 15:27 ispconfig Debug Add server alias: c
2009-03-26 15:27 ispconfig Debug Add server alias: b
2009-03-26 15:27 ispconfig Debug Disable SSL for: a
2009-03-26 15:27 ispconfig Debug Call function 'update' in plugin 'apache2_plugin' raised by event 'web_domain_update'.
2009-03-26 15:27 ispconfig Debug Call function 'ssl' in plugin 'apache2_plugin' raised by event 'web_domain_update'.
2009-03-26 15:27 ispconfig Debug Found 1 changes, starting update process.
2009-03-26 15:27 ispconfig Debug Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock

a.vhost

<Directory /var/www/a>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>

<VirtualHost *:80>
DocumentRoot /var/www/a/web

ServerName a
ServerAlias www.a www.b b www.c c
ServerAdmin webmaster@a

ErrorLog /var/log/ispconfig/httpd/a/error.log

ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 503 /error/503.html

<Directory /var/www/a/web>
Options FollowSymLinks
AllowOverride Indexes AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
<Directory /var/clients/client1/web1/web>
Options FollowSymLinks
AllowOverride Indexes AuthConfig Limit
Order allow,deny
Allow from all
</Directory>

# mod_php enabled
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@a"
php_admin_value upload_tmp_dir /var/clients/client1/web1/tmp
php_admin_value session.save_path /var/clients/client1/web1/tmp
#php_admin_value open_basedir /var/clients/client1/web1:/usr/share/php5

RewriteEngine on
RewriteCond %{HTTP_HOST} ^b [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^www.b [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^c [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^www.c [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
</VirtualHost>



As you see there is not the a -> www.a rule

HellMind
26th March 2009, 21:25
I also tried adding the apache directives

I added

<Directory /var/www/x.com/web/>
Options +Includes +FollowSymlinks -Indexes
AllowOverride All
Order allow,deny
Allow from all
<Files ~ "^.ht">
Deny from all
</Files>
</Directory>

But my site still hasn't permission for .htaccess

its a drupal

HellMind
26th March 2009, 22:29
the apache directives works

what happened

If you add something illegal to there, then apache doesn't restart (when you click save) so you cant see the changes or errors.

If you restart apache manually it will nost start and it will stop all the apache daemon including the ispconfig admin httpd

So editing those directives can be dangerous.
--

the auto www redirect isn't work yet

till
26th March 2009, 22:40
Rewriting rules are inserted all correctly as you can see in your vhost:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^b [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^www.b [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^c [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^www.c [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]

If they work or not depends on the domains you insert etc. For details on rewrite rules and how they work take a look here:

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

HellMind
26th March 2009, 22:43
Rewriting rules are inserted all correctly as you can see in your vhost:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^b [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^www.b [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^c [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]
RewriteCond %{HTTP_HOST} ^www.c [NC]
RewriteRule ^/(.*)$ http://www.a/$1 [L]

If they work or not depends on the domains you insert etc. For details on rewrite rules and how they work take a look here:

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

That rewrites rules are from the alias domain
c & b -> www.a

the one missing is the
auto www
a -> a.www

till
26th March 2009, 22:51
On my test server the redirect rule for the www of the main domain gets added too correctly, so there is no problem with ISPConfig. Maybe you edited something in your setup that causes this.

main domain: test.int with auto www enabled produce sthe rewrite rules:

RewriteCond %{HTTP_HOST} ^test.int [NC]
RewriteRule ^/(.*)$ http://test.com$1 [R]
RewriteCond %{HTTP_HOST} ^www.test.int [NC]
RewriteRule ^/(.*)$ http://test.com$1 [R]

HellMind
26th March 2009, 22:53
On my test server the redirect rule for the www of the main domain gets added too correctly, so there is no problem with ISPConfig. Maybe you edited something in your setup that causes this.

main domain: test.int with auto www enabled produce sthe rewrite rules:

RewriteCond %{HTTP_HOST} ^test.int [NC]
RewriteRule ^/(.*)$ http://test.com$1 [R]
RewriteCond %{HTTP_HOST} ^www.test.int [NC]
RewriteRule ^/(.*)$ http://test.com$1 [R]


I think yours also are wrong

going to

http://test.int/hello

you will be redirected to

http://test.comhello

(I had this problem too, when www. auto redirect was working)

till
26th March 2009, 23:00
Mine was just an example. If you add a / at the end then its http://test.com/hello

HellMind
26th March 2009, 23:06
Mine was just an example. If you add a / at the end then its http://test.com/hello

The problem is that you Can't modified that file
Like you said before
You must not touch it

Because if you make a change on the cfg it will overwrite it

Where is the auto www function, that add that cfg to the vhost file :S?

till
26th March 2009, 23:33
You shall not modify the file, you shall add the / in the rewrite field. And I told you already in post #8 of this thread that you can modify the template. The remplates are in /usr/local/ispcnfig/server/conf/

HellMind
26th March 2009, 23:39
You shall not modify the file, you shall add the / in the rewrite field. And I told you already in post #8 of this thread that you can modify the template. The remplates are in /usr/local/ispcnfig/server/conf/

Sorry,
I found on vhost.conf.master

RewriteEngine on
<tmpl_loop name="redirects">
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 <tmpl_var name='rewrite_type'>
</tmpl_loop>
</tmpl_if>

But if I add there the /
I I must to remove the / on all the aliases domain rediect?

How can I add the / when it do the "INSERT" on db of www auto redirects?

till
26th March 2009, 23:44
But if I add there the /
I I must to remove the / on all the aliases domain rediect?

Seems as if you do not read my posts at all. No, I did not told you to add it there. Read again post 22:

"You shall not modify the file, you shall add the / in the rewrite field."

HellMind
27th March 2009, 00:20
Seems as if you do not read my posts at all. No, I did not told you to add it there. Read again post 22:

"You shall not modify the file, you shall add the / in the rewrite field."

I'm sorry English isn't my native language

when you said
"You shall not modify the file," You weren't talking about *.vhost?
Are you talking about vhost.conf.master?


Where is, or at least how it is called the file where I shall add the /
"The templates are in /usr/local/ispcnfig/server/conf/"
I don't see where.

HellMind
27th March 2009, 22:45
Till should delete my and his post regarding to my question because its like I was talking in spanish and he in german.

My issue is very simple

I want to rediect/rewrite, domain.com TO www.domain.com

I think it can be done with the Auto-Subdomain Option.

Well, that option for me, isn't work.
It doesn't add the rewrite rule to the vhost file. (It should do that?)

I know it isn't work because, I'm not being redirected if I go to domain.com

Thank you.

till
27th March 2009, 23:17
Here is your first post in the thread:

-------------------------------------------------------------
but this isn't 100% truth

I ve modified my .vhost from apache2

Restarted apache2 and works fine

But, if I reboot, ispc restore the .vhost file

Why?
---------------------------------------------------------------

So were did you ask this question there? The first time you asked
the question how to rewrite domain.com to www.domain.com in your last post #26.

There is no redirect needed as you get the same content of the website when you
enable the auto subdomain when you enter www.domain.com
or just domain.com. Thats what the function is intended to do and
this is what the function does.

If you automatically want to rewrite domain.com to www.domain.com
which is not nescessary but can be done of course e.g for search engine optimisation, you can do this with apache rewrite rules that can be added to the apache directives field (See my post #8 part 3) in case that you want to have other rewrite rules then the ones that ispconfig adds on the rewrite tab.

For example just add:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^/(.*)$ http://www.domain.com/$1 [R]

HellMind
28th March 2009, 00:40
Here is your first post in the thread:

-------------------------------------------------------------
but this isn't 100% truth

I ve modified my .vhost from apache2

Restarted apache2 and works fine

But, if I reboot, ispc restore the .vhost file

Why?
---------------------------------------------------------------

So were did you ask this question there? The first time you asked
the question how to rewrite domain.com to www.domain.com in your last post #26.

There is no redirect needed as you get the same content of the website when you
enable the auto subdomain when you enter www.domain.com
or just domain.com. Thats what the function is intended to do and
this is what the function does.

If you automatically want to rewrite domain.com to www.domain.com
which is not nescessary but can be done of course e.g for search engine optimisation, you can do this with apache rewrite rules that can be added to the apache directives field (See my post #8 part 3) in case that you want to have other rewrite rules then the ones that ispconfig adds on the rewrite tab.

For example just add:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^/(.*)$ http://www.domain.com/$1 [R]

My question is there in the thread using a complex language :P.

The conclusion

What Auto-Subdomain Option does?
It just add a subdomain www. or *. (serveralias vhost)

If you want to do the redirect of .dom.com -> www.dom.com You should create your own .htaccess.
Or using the apache directive option.

-
I will try apache directive method.

Thank you Till

--

I think the whole problem was I had a .htaccess and that was doing the rewrite.