Renaming a TeamCity server hostname - teamcity

I am using TeamCity 6.5.4 and i'd like to rename the server (hostname).
I've seen other applications that cannot handle this, as the hostname is used internally by databses, configuration files, etc.
Is this possible? Can i just rename through Windows and be done with it ?
Also asked on this forum: http://devnet.jetbrains.net/thread/312790?tstart=0
Thanks
Lior Tal

The only thing which I am aware of is the connection of the agents. If you specified the hostname for this, you have to change it in the agent config after renaming the host.
Everything else should be fine with the rename.
Best practise therefore is to use an alias for the hostname, which doesn't change.

Related

OKD openshift-ansible: Updating 'openshift_master_cluster_public_hostname' and certificate

I have Openshift deployed and working fine, but now am putting a DNS record and a valid certificate in front of it. I haven't had any luck and haven't found any documentation on doing this.
My strategy just to update the hostname was to sed the existing public hostname with the new one in all files in the master/node configurations, but that didn't seem to work.
Is there a specific playbook/inventory fields I need to use/update in order to update this easily from the Ansible master?
UPDATE: I ran the 'openshift-master/redeploy-certificates.yaml' after I updated the inventory file with the following:
openshift_master_overwrite_named_certificates=true
openshift_master_cluster_public_hostname=new-public-hostname.com
Afterwards I checked the certs on the master node and they seemed to have added a new SAN to the master.server.crt and etcd.server.crt. However, when I go to the new hostname, it still redirects me to the old hostname. Is there another playbook I'm missing to update that in the system?
The redirection might be caused by the web console service that probably is not configured and uses the old masterURL.
Check this previous thread https://stackoverflow.com/a/54399071/2802150 as it addresses the same problem.

Clone development environment on an office server to use locally

Situation:
As a developer I'd like to "clone" our development environment (on an office server) so we can use it locally (for example when no/limited internet access is available). We've decided to give Vagrant a try.
What did I do?
First I used PuPHPet to create a basic config including nginx, php (incl modules), composer, git, memcached etc. You can find my config here. I also added a nginx vhost for our website.dev. This is where I run into the first problem.
We use a few additional config settings to the location block. A rewrite, a fastcgi_pass and a include. This is not available so I searched a lot online and I found out I could use the following statement (was more a try/fail/retry).
location_cfg_append:
{ rewrite: ".* /dispatch.php break", include: "fastcgi-params.conf", fastcgi_pass: "127.0.0.1:9000" }
First question:
This does work, however is this the way to do this? I'm not sure if I should be editing this config file (the file generated by PuPHPet) directly.
Second question:
How should I 'upload' the fastcgi-params.conf file I want to include? I did not find a way to do this in the config.yaml but there is a way to run some scripts. For now I've added a echo [contents] > /etc/nginx/fastcgi-params.conf that does work. However...
Third question:
When the VM is provisioned the nginx config is created. When that is done nginx is restarted. However at that moment the fastcgi-params.conf file does not exist yet (this is created AFTER the provisioning).
When nginx reloads this will fail, trigger an error and the machine can not finish the provision sequence (so it will never create the config file).
I can create this file on the next boot (and then nginx will work) but this cannot be the correct way to do this. So: how can I (before nginx 'installation') create / deploy a file to the VM? Or more generic (question 2): How can I upload a file to the VM?
If this is totally not the way to go please let me know! This are our first steps into creating a locally development machine so other/better methods are welcome.
First question: This does work, however is this the way to do this? I'm not sure if I should be editing this config file (the file generated by PuPHPet) directly.
Yes, I encourage this.
Second question: How should I 'upload' the fastcgi-params.conf file I want to include?
Place it inside one of your shared folders. It'll be available within the VM and you can reference it that way.
Third question
The above answer fixes this issue.

Codeigniter - Using environments with different hosts

I was wondering if someone could help me.
I have started using version control (git) for my website which is using CodeIgniter.
Everytime i transfer files from my localhost host to my live server, i always have to go through all my files and change the config details.
I came across a post saying i could do all this with the ENVIRONMENT settings in the index.php file automatically based on the SERVER_NAME.
Has anybody done this before? if so, would it be possible to let me know how its done properly?
Cheers,
Try this for a start (index.php):
if ($_SERVER["HTTP_HOST"] == 'devserver1' || $_SERVER["HTTP_HOST"] == 'devserver2')
define('ENVIRONMENT', 'development');
else
define('ENVIRONMENT', 'production');
Then, whenever you need it, you check for the ENVIRONMENT constant (for example, different database settings, etc.). For localhost, simply check if the server is 'localhost' ($_SERVER["HTTP_HOST"] == 'localhost'), or whichever virtual host name you might be using.
You could always use environment variables
http://httpd.apache.org/docs/2.2/env.html
This will allow you to get the environment instead of hard coding the information in your code
This may also help you out
http://docstore.mik.ua/orelly/linux/apache/ch04_06.htm
Not sure if you're still needing help with this, but I had this issue a while ago and released a CodeIgniter module which is designed to automatically handle multiple environments.
I'm shameful to be plugging myself, but it's saved me lots of editing and it might be of use to anyone else that'll read this post in the future.
Here's the link to the Git repo: https://github.com/jedkirby/ci-multi-environments and this is a brief explanation of why and how I made the module: http://jedkirby.com/blog/2012/11/codeigniter-multiple-development-environments

Windows - Private hosts file for a certain environment

I've an application running on a dev server and connecting to a dev-db hosting an oracle instance.
Now i'm deploying the on a prod/prod-db machine
Since the dev-db url is hardcoded inside the java code, the just-copied binaries still points to dev-db. As a quick warkaround i added a line in Windows Host file on prod so that dev-db now points to prod-db IP address. It's work, but i'm not very satisfied of this global-scope solution.
I was wondering if exits a way to make a hosts file "private" for a certain environments ie. only valid in the scope of my running application
No, there's no way to do this, and it's a bad approach anyway.
You should instead fix the real problem, which is the hard-coding of the address inside your java code. Put such things in a properties file, and use a different properties file for production.

Locate the path of an Apache server on windows

For a windows script I am writing, I need to detect if the machine has Apache 2.2 installed, and to find the application path.
One solution I came up with is to wget http://localhost:8080/server-info and parse the root and the config file from it. This would fail if the server does not use port 8080
Another option would be to call “sc qc Apache2.2” and to parse the returning string. This would fail if the server is not installed as a service, or is using a different name.
Is there any better way to do that?
Not a lot of great options if they didn't install it using the installer. If they used the MSI/installer, you can check the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Apache\2.2.2\ServerRoot
HKEY_CURRENT_USER\SOFTWARE\Apache Software Foundation\Apache\2.2.2\ServerRoot
You can also check the running process list:
WMIC PROCESS get Caption,Commandline,Processid
Look for the appropriate EXE. If for some reason you needed the port number, then use netstat and search for the appropriate port.
Also, when you say "a windows script", I am assuming you are using something modern and capable like Windows Scripting Host (my favorite) or PowerShell. Don't even bother with batch files.
As I recall, Apache writes some registry keys. If you know how to read them from a script, that might help.
uvdesk
Unable to locate the path on the server.
Try putting index.php after your helpdesk installation's site url or If you are using apache, make sure that mode_rewrite module is enabled and AllowOverride directive for document root is set to All/FileInfo in your server's configuration file.[enter code here][1]

Resources