Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Mail Server
  • Search

Roundcude re install

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
oobydoo
Posts: 9
Joined: Thu Jan 14, 2016 2:10 pm

Roundcude re install
  • Quote

Post by oobydoo » Tue Mar 01, 2016 11:17 am

Hi,

Anyone got a nice .sh script to reinstall roundcube to Vesta speck?
Or a remove and re install but to Vesta config they are willing to share

here is the standard one needs editing!

Code: Select all

#!/bin/sh

clear

if [ -z "${mysql_roundcube_password}" ]; then
 tmp=$(</dev/urandom tr -dc A-Za-z0-9 | head -c12)
 read -p "MySQL roundcube user password [${tmp}]:" mysql_roundcube_password
 mysql_roundcube_password=${mysql_roundcube_password:-${tmp}}
 echo "MySQL roundcube: ${mysql_roundcube_password}" >> .passwords
fi
	
if [ -z "${mysql_root_password}" ]; then
  read -p "MySQL root password []:" mysql_root_password
fi


wget -P /var/www/html http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/1.1.0/roundcubemail-1.1.0.tar.gz
tar -C /var/www/html -zxvf /var/www/html/roundcubemail-*.tar.gz
rm -f /var/www/html/roundcubemail-*.tar.gz
mv /var/www/html/roundcubemail-* /var/www/html/roundcube
mv /var/www/html/roundcube/composer.json-dist /var/www/html/roundcube/composer.json
(cd /var/www/html/roundcube && curl -sS https://getcomposer.org/installer | php && php composer.phar install --no-dev)

chown root:root -R /var/www/html/roundcube
chmod 777 -R /var/www/html/roundcube/temp/
chmod 777 -R /var/www/html/roundcube/logs/

cat <<'EOF' > /etc/httpd/conf.d/20-roundcube.conf
Alias /webmail /var/www/html/roundcube

<Directory /var/www/html/roundcube>
  Options -Indexes
  AllowOverride All
</Directory>

<Directory /var/www/html/roundcube/config>
  Order Deny,Allow
  Deny from All
</Directory>
	
<Directory /var/www/html/roundcube/temp>
  Order Deny,Allow
  Deny from All
</Directory>
	
<Directory /var/www/html/roundcube/logs>
 Order Deny,Allow
Deny from All
</Directory>
EOF

sed -e "s|mypassword|${mysql_roundcube_password}|" <<'EOF' | mysql -u root -p"${mysql_root_password}"
USE mysql;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'mypassword';
GRANT USAGE ON * . * TO 'roundcube'@'localhost' IDENTIFIED BY 'mypassword';
CREATE DATABASE IF NOT EXISTS `roundcube`;
GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;
EOF
	
	mysql -u root -p"${mysql_root_password}" 'roundcube' < /var/www/html/roundcube/SQL/mysql.initial.sql
	
	cp /var/www/html/roundcube/config/config.inc.php.sample /var/www/html/roundcube/config/config.inc.php
	
	sed -i "s|^\(\$config\['db_dsnw'\] =\).*$|\1 \'mysqli://roundcube:${mysql_roundcube_password}@localhost/roundcube\';|" /var/www/html/roundcube/config/config.inc.php
	sed -i "s|^\(\$config\['smtp_server'\] =\).*$|\1 \'localhost\';|" /var/www/html/roundcube/config/config.inc.php
	sed -i "s|^\(\$config\['smtp_user'\] =\).*$|\1 \'%u\';|" /var/www/html/roundcube/config/config.inc.php
	sed -i "s|^\(\$config\['smtp_pass'\] =\).*$|\1 \'%p\';|" /var/www/html/roundcube/config/config.inc.php
	#sed -i "s|^\(\$config\['support_url'\] =\).*$|\1 \'mailto:${E}\';|" /var/www/html/roundcube/config/config.inc.php
	
	deskey=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9-_#&!*%?' | fold -w 24 | head -n 1)
	sed -i "s|^\(\$config\['des_key'\] =\).*$|\1 \'${deskey}\';|" /var/www/html/roundcube/config/config.inc.php
	
	rm -rf /var/www/html/roundcube/installer
	
	service httpd reload
The download url will differ I am using Centos 6.7
wget -P /var/www/html http://downloads.sourceforge.net/projec ... 1.0.tar.gz



Mike
Top

oobydoo
Posts: 9
Joined: Thu Jan 14, 2016 2:10 pm

Re: Roundcude re install
  • Quote

Post by oobydoo » Sat Mar 05, 2016 1:49 pm

We have a config error we do not want to reinstall as the server is mint
apart from we have to restart apache once a day as the memory runs out if not.
The error is roundcube was put it after and is not standard as vesta wants.

Stopping httpd: [ OK ]
Starting httpd: [Sat Mar 05 10:31:03 2016] [warn] module ruid2_module is already loaded, skipping
Warning: DocumentRoot [/usr/share/roundcubemail] does not exist
Warning: DocumentRoot [/var/lib/roundcube] does not exist
Warning: DocumentRoot [/var/lib/roundcube] does not exist
Warning: DocumentRoot [/var/lib/roundcube] does not exist
[Sat Mar 05 10:31:04 2016] [error] (EAI 2)Name or service not known: Could not resolve host name 45.32.182.218:%ssl_port% -- ignoring!
Warning: DocumentRoot [/var/lib/roundcube] does not exist
[ OK ]

These errors from apache are because we change roundcube to the vesta folders /etc/roundcubemail/
So the apache conf is looking in the wrong place so I can change them in apache right!
But then it's not standard vesta!
So updates will not match


Mike
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Mail Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password