Koozali.org: home of the SME Server
Obsolete Releases => SME Server 9.x => Topic started by: Charles2008 on June 25, 2014, 01:53:24 AM
-
I have been examining EspoCRM at espocrm.com
I have tried to load it on to a SME9 test-server and have an error on install:
"API Error: EspoCRM API unavailable.
Possible problems: disabled "mod_rewrite" in Apache server or .htaccess support.
To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>
AllowOverride All
</Directory>
Afterwards run this command in a Terminal:
service apache2 restart
To enable "mod_rewrite" run those commands in a Terminal:"
a2enmod rewrite
service apache2 restart
Now, I am aware that EspoCRM requires the following:
PHP 5.4 with pdo, json, GD Library, mcrypt
MySQL 5.1
and SME9 has:
PHP 5.3.3-23 ... not sure about the other 4 requirements (but I think that I recognise them)
MySQL 5.1
Apparently, the PHP requirement isn't thought to be likely to pose any operational issues (their Forum). I will find out how accurate this proves to be :-)
BTW, for anyone interested in trying this themselves, I had to modify the value of:
'phpVersion' => '5.4',
to
'phpVersion' => '5.3',
in the file /install/core/SystemHelper.php
Earlier I tried to install on SME8 and had the same error. I hunted around contribs.org and found this:
http://forums.contribs.org/index.php?topic=42071.0
db accounts setprop Primary AllowOverride All
db accounts setprop Primary FollowSymLinks enabled
signal-event ibay-modify Primary
... replacing 'Primary' for my iBay.
This didn't work and so I am wondering if anybody can point me in the right direction.
-
Some more info here
http://forums.contribs.org/index.php/topic,42071.0.html
and here
http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server
-
take a look to that contribs http://wiki.contribs.org/Webhosting but only for sme9
You will have some new options to apache and PHP. Really useful
-
@TerryF - thanks for those links. The Joomla article was very instructive.
@stephdl
I have just tried installing the contrib Webhosting, and there seems to be a problem (I tried twice, just to make sure):
I initially set the stephdl repository, then:
[root@home ~]# yum --enablerepo=stephdl install smeserver-webhosting
Loaded plugins: fastestmirror, smeserver
Loading mirror speeds from cached hostfile
* base: mirror.sov.uk.goscomb.net
* smeaddons: mirror.absolutnet.de
* smeextras: mirror.absolutnet.de
* smeos: mirror.absolutnet.de
* smeupdates: mirror.absolutnet.de
* updates: mirror.sov.uk.goscomb.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package smeserver-webhosting.noarch 0:0.0.9-1.el6.sme will be installed
--> Processing Dependency: smeserver-mod_dav for package: smeserver-webhosting-0.0.9-1.el6.sme.noarch
--> Finished Dependency Resolution
Error: Package: smeserver-webhosting-0.0.9-1.el6.sme.noarch (stephdl)
Requires: smeserver-mod_dav
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@home ~]#
-
I loaded the DAV contrib and that then allowed the Webhosting contrib to run properly. (I have modified Wiki for Webhosting)
http://wiki.contribs.org/DAV
I now have a new option in Server-Manager, under 'Collaboration' - I-bays Web Hosting.
I have set:
Allow directory listing (+Indexes) - ENABLED
Follow symbolic links (FollowSymLinks) - ENABLED
Allow .htaccess policy (AllowOverride) - ENABLED
... but, the problem (and the error message above) remain unchanged.
-
You have enabled a .htaccess but did you make a .htaccess in the relevant ibay with content needed ?
-
I had no trouble installing EspoCRM (with the hint from Charles2008 to change the required phpVersion).
With my Primary ibay setup like this:
Primary=ibay
AllowOverride=All
CgiBin=enabled
FollowSymLinks=enabled
Group=shared
Modifiable=no
Name=Primary i-bay
PHPBaseDir=/home/e-smith/files/ibays/Primary/:/tmp/
PasswordSet=no
Passwordable=no
PublicAccess=global
Removable=no
UserAccess=wr-admin-rd-group
I setup EspoCRM as follows:
#
mkdir -p ~/addons/espocrm
cd ~/addons/espocrm
RELEASE=1.2.0
wget http://downloads.sourceforge.net/project/espocrm/EspoCRM-$RELEASE.zip
unzip EspoCRM-$RELEASE.zip
mv EspoCRM-$RELEASE /home/e-smith/files/ibays/Primary/html/espo
cd /home/e-smith/files/ibays/Primary/html
chown -R www:www *
#
# create a database
mysql -e "create database espo; grant all privileges on espo.* to 'espo'@'localhost' identified by 'put-your-OWN-secure-password-here' with grant option;"
#
#
# manually edit espo/install/core/SystemHelper.php to change the required PHP version from 5.4 to 5.3.3
# Change line 28 from this:
# 'phpVersion' => '5.4',
# to this
#'phpVersion' => '5.3.3',
#
# browse to the espo URL and complete the setup
# http://mysmeserver.tld/espo
#
# during setup:
# mysql port = 3303
# mysql server = localhost
# mysql user = espo
# mysql password = put-your-OWN-secure-password-here
[/code
-
I also modified /home/e-smith/files/ibays/Primary/html/espo/.htaccess after install to force SSL connections:
The default EspoCRM .htaccess looked like this:
DirectoryIndex index.php index.html
RedirectMatch 403 \.config$
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule reset/?$ reset.html [QSA,L]
</IfModule>
I added two lines above the closing </IfModule> tag:
DirectoryIndex index.php index.html
RedirectMatch 403 \.config$
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule reset/?$ reset.html [QSA,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
-
@stephdl
No I haven't created an .htaccess file - do I really have to do that? I have successfully uploaded and configured quite a few programmes to ibays and haven't yet (knowingly) set one up. I had a look at the Htaccess page and it is quite daunting.
http://wiki.contribs.org/Htaccess
@mmccarn
Oh excellent!
At least in my little struggles I know that there is light at the end of the tunnel - thank you.
I am trying to install to an ibay and will continue with that. You have very helpfully set out the details of how to do it to the Primary ibay, for those interested in that method.
Once I ran:
db accounts show crm
It became obvious that although I had set
WebDav = ENABLED ... in ibays-Web Hosting in server-manager, I still had to manually enable it at the CL
http://wiki.contribs.org/DAV
db accounts setprop ibay-name ModDav enabled
signal-event ibay-modify ibay-name
My issue now is that although I have set in server-manager
Group = Everyone, and
Public access via web or anonymous ftp = Entire Internet (no password required)
I am being asked to provide a username/password in the install process - and not the one I set in the first part of the install. This doesn't strike me as normal. I am reluctant to enter my Admin password at this stage.
mmccarn - did you have to do this? (or am I paranoid :-?)
-
It became obvious that although I had set
WebDav = ENABLED ... in ibays-Web Hosting in server-manager, I still had to manually enable it at the CL
then you should report it as a bug :-)
-
@ Stefano
Bug 8466 - http://bugs.contribs.org/show_bug.cgi?id=8466 - ibays-Web Hosting (in server-manager) NOT A BUG.
@mmccarn
Further info - current ibay settings:
db accounts show crm
crm=ibay
AllowOverride=All
AllowUrlfOpen=disabled
CgiBin=enabled
FollowSymLinks=enabled
Gid=5001
Group=shared
Indexes=disabled
MaxExecTime=disabled
MemoryLimit=disabled
ModDav=enabled
Name=EspoCRM
PHPBaseDir=/home/e-smith/files/ibays/crm/:/tmp/
PasswordSet=no
PostMaxSize=disabled
PublicAccess=global
SSL=enabled
Uid=5001
UpMaxFileSize=disabled
UserAccess=wr-admin-rd-group
Now no longer getting original error message, but being asked for password in the SME style pop-up:
"A username and password are being requested by https://<my LAN server ip>. The site says: "crm""
Am I right to think this abnormal? I haven't finished the install yet (or maybe I have and I am being asked for my p/w to access the first page)
This looks odd to me.
-
then you should report it as a bug :-)
It works for me.
Can you confirm that you are writing.
set an ibay
enable internet access in the ibay panel
go to web hosting panel and enable webdav
then with nautilus (i don't use window) i can reach the ibay with a sme user (using the webdav protocol) and write in the ibay if the permissions set in the ibay panel allow it.
-
@stephdl
That is not what I did. Moreover, I am unfamiliar with Nautilus and I have moved on with the install.
I will reload the SME9.iso from scratch and retest to confirm. I wouldn't like to report a bug that didn't exist. :)
-
In France we have an expression, the bug is often between the keyboard and the chair :)
-
In France we have an expression, the bug is often between the keyboard and the chair :)
On the other hand, often when other is looking or test your work, you can find some interesting food for thought.
Is there are a lot of people who use the Primary Ibay to manage websites, my reflex is to avoid to use that ibay....I say that because i do not allow to manage https or php settings with smeserver-webhosting to this ibay, but it is possible to let the sysadmin decide.
@mmccarn ?
-
@stephdl
... you were right - the bug must have been me! 8) I have canceled the above bug 8466. However in my reinstall process, I DID find a bug. I will post the link once I have reported it.
Bug 8467 Submitted - http://bugs.contribs.org/show_bug.cgi?id=8467
Incorrectly detecting installed SME OS.
-
@mmccarn
In my second SME9.iso install I have decided to follow your instructions and install to the Primary ibay.
I have followed the installation to the point where I submit the database information.
I then get this message:
The mcrypt PHP extension was not found...
I have found a guide to installing mcrypt here:
http://forums.contribs.org/index.php/topic,50474.0.html
So I have configured Dag and Epel and then run:
yum install *mcrypt --enablerepo dag --enablerepo epel
...
Running Transaction
Installing : libmcrypt-2.5.8-9.el6.i686 1/5
Installing : libtommath-0.42.0-3.el6.i686 2/5
Installing : libtomcrypt-1.17-21.el6.i686 3/5
Installing : mcrypt-2.6.8-10.el6.i686 4/5
Installing : php-mcrypt-5.3.3-3.el6.i686 5/5
Verifying : libtomcrypt-1.17-21.el6.i686 1/5
Verifying : libtommath-0.42.0-3.el6.i686 2/5
Verifying : mcrypt-2.6.8-10.el6.i686 3/5
Verifying : php-mcrypt-5.3.3-3.el6.i686 4/5
Verifying : libmcrypt-2.5.8-9.el6.i686 5/5
Installed:
libmcrypt.i686 0:2.5.8-9.el6 libtomcrypt.i686 0:1.17-21.el6
mcrypt.i686 0:2.6.8-10.el6 php-mcrypt.i686 0:5.3.3-3.el6
Dependency Installed:
libtommath.i686 0:0.42.0-3.el6
Complete!
However, Espo installer is still saying "The mcrypt PHP extension was not found..."
Any idea what I have missed?
-
Is there are a lot of people who use the Primary Ibay to manage websites, my reflex is to avoid to use that ibay....I say that because i do not allow to manage https or php settings with smeserver-webhosting to this ibay, but it is possible to let the sysadmin decide.
@mmccarn ?
I doubt that there are many who install webapps into the Primary ibay.
I do it for quick feasibility testing of webapps -- if I can get an app to work in a folder in the Primary ibay, I can get it to work in a dedicated ibay, too. If I really want to use the app, I'll create an i-bay and either move the installed code from Primary or reinstall. If I don't like it, I delete the folder and the database and I'm done.
On a production system I would assume that sharing multiple webapps in the Primary ibay increases security exposure:
- someone who compromises one of my installed webapps may be able to compromise another by writing malicious code into the shared temp file location
- or a weakness in one webapp may expose configuration info (db credentials, for example) from another webapp.
(If I can *imagine* these vulnerabilities, some genius somewhere can probably use them...)
-
@mmccarn
... Espo installer is still saying "The mcrypt PHP extension was not found..."
Any idea what I have missed?
You may need to restart httpd-e-smith or reboot
sv t httpd-e-dmith
or
signal-event post-upgrade; signal-event reboot
I must have installed mcrypt for something else...
On my system, the command on the top line produces the output shown:
# php -r "phpinfo();" |grep mcrypt
/etc/php.d/mcrypt.ini,
Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
-
@mmccarn
Thanks for the advice. It was just a reconfigure & reboot that was needed,
signal-event post-upgrade; signal-event reboot
I now have it up and running.
Thanks again.
-
You're welcome.
If you use EspoCRM long term, consider creating a wiki page to document the install process (and the other lessons you're bound to learn...).
If your install is working, please change the title of this thread to '[SOLVED] EspoCRM install problem'
-
Ok, I am struggling with loading EspoCRM into a normal ibay. I am hugely encouraged having been able to get it up-and-running in the Primary ibay (thanks mmccarn) but the normal ibay seems to need something more.
I am assuming that this has got to do with this software using an .htaccess file. I am presuming that as I am now installing to a regular Ibay (and not Primary) I will need to create a 'custom template fragment' to modify my htttpd.conf. Is this right, or am I barking up the wrong tree?
So I have created ibay, created database, chown and chmod the ibay, run the installer and get (as per my opening post):
API Error: EspoCRM API unavailable.
Possible problems: disabled "mod_rewrite" in Apache server or .htaccess support.
To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>
AllowOverride All
</Directory>
Afterwards run this command in a Terminal:
service apache2 restart
To enable "mod_rewrite" run those commands in a Terminal:"
a2enmod rewrite
service apache2 restart
When I run:
db accounts show crm
I get
crm=ibay
AllowOverride=All
AllowUrlfOpen=disabled
CgiBin=enabled
FollowSymLinks=enabled
Gid=5000
Group=shared
Indexes=enabled
MaxExecTime=disabled
MemoryLimit=disabled
ModDav=enabled
Name=CRM
PHPBaseDir=/home/e-smith/files/ibays/crm/:/tmp/
PasswordSet=no
PostMaxSize=disabled
PublicAccess=local
SSL=enabled
Uid=5000
UpMaxFileSize=disabled
UserAccess=wr-admin-rd-group
I assume the settings listed immediately above relate to the ibay overall and not to specific files and directories (.htaccess application). Are these settings applied via the httpd.conf also (like a 'custom template fragment'?).
I have no doubt that I can follow the instructions in http://wiki.contribs.org/Htaccess but I don't really UNDERSTAND what I am doing?
Can anyone
(1) confirm that I need a 'custom template fragment' and that I am not simply doing something else simple wrong, and
(2) explain how the httpd.conf and the .htaccess access file are supposed to work together (or not).
Currently there is no .htaccess file present in /api/v1/<.htaccess not present> - I presume because the installer hasn't been able to create one.
-
I'll put it into an ibay and post the steps later today or tomorrow.
-
Thank you .... I think that I'm going to name my first ibay after you :D
Further info. I am pretty sure that the the path to ,htaccess file is supposed to be:
/api/v1/.htaccess
and the contents are supposed to be:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
I don't know if this is any help, but were going to my cunning next steps.
-
It seems that EspoCRM insists on using a url in the root of your domain named "/home", and that some detail of the SME ibay setup causes Espo to look for that location in the Primary ibay.
I created an ibay named "espocrm", and got everything (almost) working at http://mysmeserver.tld/espocrm -- except I was getting the error you've been seeing, and /var/log/httpd/error_log was complaining about a non-existent "/home/e-smith/files/ibays/Primary/html/home".
I created a new domain in server-manager (espo.mysmeserver.tld) and configured it to serve content from the "EspoCRM" ibay I created earlier.
Hey presto - Espo at http://espo.mysmeserver.tld
It still doesn't work at http://mysmeserver.tld/espo
(If you follow the new domain approach, you'll need to setup an external DNS server to let folks get to your espo server by name)
-
I would never have gotten that.
I created a new domain in server-manager (espo.mysmeserver.tld) and configured it to serve content from the "EspoCRM" ibay
How is this configured in server-manager?
How is it configured to 'serve content'?
Hey presto - Espo at http://espo.mysmeserver.tld
Will this work on an internal network? e.g.
https://espo.192.xxx.xx.xxx
So, no 'custom template fragment' to modify my htttpd.conf?
Also, I am assuming that the .htaccess was auto-created upon install, or did you have to do it manually?
Thank you for you help.
-
How is this configured in server-manager?
How is it configured to 'serve content'?
On the domain create/edit screen near the middle there is a field "i-bay" -- select the ibay that you installed EspoCRM into.
Will this work on an internal network? e.g.
https://espo.192.xxx.xx.xxx
No - use the domain you create, which should be a full domain name since you will need to create an external dns entry with the same name in order to access espo from off-site.
So, no 'custom template fragment' to modify my htttpd.conf?
Also, I am assuming that the .htaccess was auto-created upon install, or did you have to do it manually?
Thank you for you help.
Right - no custom template fragments are needed, and .htaccess is either created during the install or is extracted from the source files.
-
@mmccarn
Thank you for the details.
I am thinking now that perhaps the Primary ibay was a better home for this app. Particularly if I was planning on local access only.
-
Hi Charles,
please see: http://forums.contribs.org/index.php/topic,50928.0.html
Cheers,
guest
-
@mmccarn
... Particularly if I was planning on local access only.
If your SME server is providing DNS to your LAN, any domain you create will work locally -- you just need to use the domain name instead of the IP address.
I've just tested this with a domain named "espocrm.tld" (literally). "espocrm" by itself and "espocrm.local" did not work.
You may need to edit .../data/config.php to correct the setting of "siteURL" (near the bottom of the file) to avoid reinstalling.
-
Thanks mmccarn, I will take a look.