Hi everyone,
Some changes were made to the development environment in order to:
- Add git/github support
- Provide a migration path to github (which is happening post ClearOS 6.5.0)
- Provide a stable version of the framework (no more "SVN trunk")
Under the hood, the default engine is switching from using the development framework & theme in SVN (typically exported to ~/clearos/webconfig) to the live framework & theme version in /usr/clearos. It's not a big change, but it is one that requires some manual changes detailed below.
Sorry for the hassle, but these changes will prevent such annoyances in the future! If you have any problems, please contact me.
Upgrade to the latest ClearOS version
First, you need to upgrade your development system to the latest ClearOS release: 6.5.0 (beta)
If you don't want to upgrade right now, that's fine too of course.
Update framework settings
Most of you probably want to start using the stable version of the framework instead of SVN trunk. If you want to move to the stable version, remove the references to the CLEAROS_BOOTSTRAP environment variable in ~/.bash_profile. You will need to re-login, or unset the environment variable after making the change.
If you want to continue use the bleeding edge framework in SVN, leave the CLEAROS_BOOTSTRAP environment variable as is. However, you need to update to the latest framework version in SVN trunk:
Update the Apache configlet
Using your regular user account (not root), update the Apache configlet. Make a backup just in case you need to review it:
The "clearos -w setup" command resets the /usr/clearos/sandbox/etc/httpd/conf.d/devel.conf file so that the default framework and theme are used.
Create/update your ~/.clearos configuration
If you want to keep the development/SVN versions of the ClearFoundation and ClearCenter apps / themes in your environment, your .clearos file should look like:
After making necessary changes to .clearos, you need to reload webconfig with the new path information:
clearos reload
If all you need to see is your own app, then your .clearos configuration should have a single entry:
Change my_apps to whatever subdirectory in your home directory contains your app source code.
Framework Development
If you ever need to use the development versions of the framework, you can find the document on the topic here:
http://www.clearfoundation.com/docs/developer/framework/tutorials/framework_development_version
Some changes were made to the development environment in order to:
- Add git/github support
- Provide a migration path to github (which is happening post ClearOS 6.5.0)
- Provide a stable version of the framework (no more "SVN trunk")
Under the hood, the default engine is switching from using the development framework & theme in SVN (typically exported to ~/clearos/webconfig) to the live framework & theme version in /usr/clearos. It's not a big change, but it is one that requires some manual changes detailed below.
Sorry for the hassle, but these changes will prevent such annoyances in the future! If you have any problems, please contact me.
Upgrade to the latest ClearOS version
First, you need to upgrade your development system to the latest ClearOS release: 6.5.0 (beta)
If you don't want to upgrade right now, that's fine too of course.
yum --enablerepo=clearos-updates-testing,clearos-developer upgrade
Update framework settings
Most of you probably want to start using the stable version of the framework instead of SVN trunk. If you want to move to the stable version, remove the references to the CLEAROS_BOOTSTRAP environment variable in ~/.bash_profile. You will need to re-login, or unset the environment variable after making the change.
If you want to continue use the bleeding edge framework in SVN, leave the CLEAROS_BOOTSTRAP environment variable as is. However, you need to update to the latest framework version in SVN trunk:
svn update ~/clearos/webconfig/framework
Update the Apache configlet
Using your regular user account (not root), update the Apache configlet. Make a backup just in case you need to review it:
sudo cp /usr/clearos/sandbox/etc/httpd/conf.d/devel.conf \
/usr/clearos/sandbox/etc/httpd/conf.d/devel.conf.bak
clearos -w setup
The "clearos -w setup" command resets the /usr/clearos/sandbox/etc/httpd/conf.d/devel.conf file so that the default framework and theme are used.
Create/update your ~/.clearos configuration
If you want to keep the development/SVN versions of the ClearFoundation and ClearCenter apps / themes in your environment, your .clearos file should look like:
<?php
\clearos\framework\Config::$apps_paths[] = 'clearcenter/webconfig/apps';
\clearos\framework\Config::$apps_paths[] = 'clearos/webconfig/apps';
\clearos\framework\Config::$theme_paths = array('clearos/webconfig/themes');
After making necessary changes to .clearos, you need to reload webconfig with the new path information:
clearos reload
If all you need to see is your own app, then your .clearos configuration should have a single entry:
<?php
\clearos\framework\Config::$apps_paths[] = 'my_apps';
Change my_apps to whatever subdirectory in your home directory contains your app source code.
Framework Development
If you ever need to use the development versions of the framework, you can find the document on the topic here:
http://www.clearfoundation.com/docs/developer/framework/tutorials/framework_development_version
Share this post:
Responses (13)
-
Accepted Answer
All went fine for me too except I bumped into the same problem as Tim reported (blank /usr/clearos/sandbox/etc/httpd/conf.d/devel-paths.conf file)...even after 'clearos reload' when checking the sudoers file.
As soon as I added the directives you posted in a previous post, everything worked.
Thx.
B. -
Accepted Answer
Tim Burgess wrote:
@Pete - no it created a blank devel-paths.conf file. It may be because I have an LDAP developer user and setup my dev environment manually before the clearos command... I'll check
Doh! The "clearos reload" command assumes that you have the same sudo access rights as webconfig. Adding the following to /etc/sudoers should resolve the issue:
your_username ALL=NOPASSWD: CC
-
Accepted Answer
Hi Fredrik,
In the tutorial in the first post in this thread it says that I should run "clearos -w setup" as an "regular" user. But that will not work since either the developer user account has not yet been created or a regular user (created in the user mgmt app in webconfig) will not be allowed to login at the console (and is as Peter says bad practice).
Sorry for the confusion - I knew this was going to be a bit of a hassle!
The "-w" flag is only intended for those who already have a development environment up and running (i.e. ran "clearos setup" weeks or months ago). For new development environments, you can ignore the upgrade instructions posted here and jump right into the regular documentation.
Here's what I suggest:
- Move your current development directory out of the way (e.g. mv /home/testguy /home/testguy.bak)
- Delete the development account (e.g. testguy) from LDAP and/or the shadow system
- Follow these instructions
- Copy files out of /home/testguy.bak to restore what you need
One gotcha: please check the /etc/sudoers file for duplicate lines that start with your user account. -
Accepted Answer
-
Accepted Answer
@Yaye - no only for webconfig app development. Building RPMs is completely seperate
@Frederik - Sorry I had mislead you in my reply (I used an LDAP user for bash login so used the shell extension). As Pete notes the 'clearos setup' command creates a system user for development, and therefore the 'clearos -w setup' is normally run first time as the root user. For more details see the other developer docs http://www.clearfoundation.com/docs/developer/development_environment
@Pete - no it created a blank devel-paths.conf file. It may be because I have an LDAP developer user and setup my dev environment manually before the clearos command... I'll check -
Accepted Answer
Hm,
Do we have a chicken/egg situation here? I really would like to setup my environment to meet all good practices etc, but I do not quite get it in this case.
In the tutorial in the first post in this thread it says that I should run "clearos -w setup" as an "regular" user. But that will not work since either the developer user account has not yet been created or a regular user (created in the user mgmt app in webconfig) will not be allowed to login at the console (and is as Peter says bad practice).
Should the command
clearos -w setup
be run as root, and after that I should continue and login as the new user and continue there to do all commands?
/Fred -
Accepted Answer
-
Accepted Answer
Hi Tim,
Pete - is there some extra config for 'approot'? none of the SVN images or paths seems to work.
Does the "clearos reload" command work? This creates the /usr/clearos/sandbox/etc/httpd/conf.d/devel-paths.conf which should contain something like the following (per app root):
Alias /clearos/approot/ /home/devuser/clearos/webconfig/apps/
<Directory /home/devuser/clearos/webconfig/apps/*/htdocs>
Order Deny,Allow
Allow from All
</Directory>
<Directory /home/devuser/clearos/webconfig/apps/*/*/htdocs>
Order Deny,Allow
Allow from All
</Directory>
<Directory /home/devuser/clearos/webconfig/apps>
Order Deny,Allow
Deny from All
</Directory>
-
Accepted Answer
Hi Fredrik,
1. It is neccessary to download the Shell Extension app from the marketplace and change the login Shell for the "ordinary development" user to something else than "nologin".
The "clearos setup" command as described here creates a developer user account in the old school shadow system (/etc/passwd /etc/shadow). Keeping the account outside LDAP is handy for developers working on the various account drivers (OpenLDAP, Samba 4)... no LDAP required.
3. Before you can do a "sudo" command as an "ordinary user" you need (as root), edit the /etc/sudoers file and add YourUserNameHere ALL=(ALL) ALL as a new line just after the "root ALL=(ALL) ALL" entry
The "clearos setup" command handles this step too :-) It doesn't grant all access but the same access as webconfig. The gory details are in this doc (which is a continuation of Tim's setup script/doc!) -
Accepted Answer
-
Accepted Answer
1. Yes - good point! It assumes that your login has basic bash access (yum install app-shell-extension-core)
2. Home directory of the developer user
3. This is not normally required, and probably discouraged as you shouldn't want to or need to give your developer user sudo rights. I tend to just 'su' back and forth if required to get root access, or run two terminals... -
Accepted Answer
Thanks for the tutorial.
However a few comments from a beginners Point of view:
1. It is neccessary to download the Shell Extension app from the marketplace and change the login Shell for the "ordinary development" user to something else than "nologin".
2. The file ~/.clearos : Does it belong to the home dir of the root user or the "ordinary user"? (My guess is the ordinary user)
3. Before you can do a "sudo" command as an "ordinary user" you need (as root), edit the /etc/sudoers file and add YourUserNameHere ALL=(ALL) ALL as a new line just after the "root ALL=(ALL) ALL" entry
/Fred
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »