tag:blogger.com,1999:blog-20077779456049136352024-02-20T03:34:41.755-08:00Notes on ITRandom notes and ramblings about my IT adventures.benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-2007777945604913635.post-82896058485627717292019-02-15T05:35:00.003-08:002019-02-15T05:38:04.790-08:00Incorrect datetime value: '0000-00-00 00:00:00' datetime<span style="font-family: inherit;">When attempting to upgrade a server's MySQL that was several version behind I ran into an error on one of the PHP pages doing an insert into a table "Incorrect datetime value: '0000-00-00 00:00:00' datetime". When I looked at the table I saw that the column in question was set to NOT NULL and had a default value of '0000-00-00 00:00:00'. After some googling I discovered that this came down to a setting that was set by default on newer version of MySQL called sql-mode. In order to fix this I ran the following command in MySQL:</span><br />
<br />
<code>show variables like 'sql_mode';</code><br />
<br />
<span style="font-family: inherit;">This showed the following:</span><br />
<br />
<code>sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION</code><br />
<code><br /></code>
<span style="font-family: inherit;">The problem is two of those in the middle, specifically, NO_ZERO_IN_DATE and NO_ZERO_DATE. I'm not sure what the others do but in deference to the builders of MySQL that put them in there by default I decided to leave the rest in there but remove those two. In order to do that I changed the my.cnf file (on my system /etc/mysql/my.cnf) and added the following line after the [mysqld] header:</span><br />
<br />
<code>sql-mode="STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"</code><br />
<br />
<span style="font-family: inherit;">After restarting the mysql server (sudo service mysql restart) when I ran the "show variables" query in MySQL it showed the proper values (i.e. missing the two problematic ones). For the record, the MySQL version is 5.7.25 and I started at 5.5.62.</span>benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-71382307415564386442018-11-16T08:08:00.001-08:002018-11-16T08:09:17.601-08:00Elementary OS - Juno - Long away suspendI recently installed Elementary OS Juno (my preferred flavor of linux because of it's simplicity, good looks, and ease of use) but was having a problem that when I left the computer for too long it would freeze up when I unlocked it. Certain windows would respond to mouse input but the top bar does not respond and neither did any system keyboard shortcuts such as Super+Space to open the applications menu. Chrome would also not respond although Firefox would which is strange. I noticed that the HDDs were spinning up after a long time away which I take as an indication that is has gone into some sort of sleep mode even though I used any and all system settings to ensure that the computer never sleeps or hibernates. After some googling I found this as a <a href="https://askubuntu.com/questions/749349/how-to-set-intel-idle-max-cstate-1/956956#956956" target="_blank">possible solution</a>:<br />
<br />
Edit /etc/defaults/grub:<br />
<br />
GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1"<br />
<br />
Then run:<br />
update-grub<br />
shutdown -r now<br />
<br />
<br />
The jury is still out on whether or not this is working 100% of the time as I don't often leave my laptop idle for long periods of time but so far I have not noticed the freezing issue.<br />
<br />benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-8919675712965491792016-02-03T05:04:00.001-08:002016-02-03T05:04:35.684-08:00Sonicwall NetExtender on UbuntuOne of the main problems with using the linux version of NetExtender on Ubuntu is that is messes with the resolvconf and does not restore it properly when it is done. Below are the commands I run to fix my resolvconf after closing NetExtender.<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">sudo rm resolv.conf </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo ln -s /run/resolvconf/resolv.conf resolv.conf </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo resolvconf -u</span>benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-63999350101333223742014-08-15T17:57:00.000-07:002015-01-21T07:57:26.512-08:00Ubuntu log-in screen<br />
Here is what /etc/lightdm/lightdm.conf looks like to remove the list of users, require users to type in their usernames to log-in, and not allow guest or remote log-ins to Ubuntu.<br />
<br />
UPDATE: On Ubuntu 13.10 the lightdm.conf file might need to be created.<br />
UPDATE: On Ubuntu 14.04 the lightdm.conf file might need to be created.<br />
<br />
[SeatDefaults]<br />
allow-guest=false<br />
greeter-show-manual-login=true<br />
greeter-hide-users=true<br />
show-remote-login=false<br />
<div>
<br /></div>benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-26035436202846655922014-04-25T05:39:00.000-07:002015-10-29T18:25:39.662-07:00PowerBroker Identity Services (formerly Likewise Open) on Ubuntu server*Likewise Open is no longer available. It has been taken over by BeyondTrust and is called PowerBroker® Identity Services, Open Edition<br />
Here are the steps I took to get PowerBroker Identity Services, Open Edition onto Ubuntu Server.<br />
<div>
Versions:</div>
<div>
<ul>
<li>Ubuntu Server 14.04 64-bit</li>
<li>PBIS Open 8.0.0.2016 - Stable Release</li>
</ul>
<ol>
<li>Log-in to server with sudo privileges</li>
<li>Be sure ssh server is installed</li>
<li><a href="http://download1.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/?Pass=True" target="_blank">Download</a> PowerBroker® Identity Services, Open Edition </li>
<li>Make script executable <ol><div style="background-color: #b0b0b0;">
<span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">$chmod +x pbis-open-8.0.0.2016.linux.x86_64.deb.sh</span>
</div>
</ol>
</li>
<li>Execute install script and follow istructions <ol><div style="background-color: #b0b0b0;">
<span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">$sudo ./pbis-open-8.0.0.2016.linux.x86_64.deb.sh</span>
</div>
</ol>
</li>
<li>Join the domain <ol><div style="background-color: #b0b0b0;">
<span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">$sudo domainjoin-cli join <domain name> <domain admin user></span>
</div>
</ol>
</li>
<li>Change default shell for domain users to bash <ol><div style="background-color: #b0b0b0;">
<span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">$</span><span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash</span>
</div>
</ol>
</li>
<li>If you would like, set the domain as default (not require <domain>\ to precede username for domain logins) <ol><div style="background-color: #b0b0b0;">
<span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">$</span><span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">sudo /opt/pbis/bin/config </span><span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">AssumeDefaultDomain true</span>
</div>
</ol>
</li>
<li>Add domain users to necessary groups in /etc/group (sudo for the admin users)</li>
<li>Clear cache <ol><div style="background-color: #b0b0b0;">
<span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">$</span><span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">sudo /opt/pbis/bin/ad-cache --delete-all</span>
</div>
</ol>
</li>
<li>Apply fix: Edit /etc/pam.d/common-session and change "session sufficient" line to
<ol><div style="background-color: #b0b0b0;"><span style="background-color: #b0b0b0; font-family: 'Courier New', Courier, monospace;">session [success=ok default=ignore] pam_lsass.so</span><br />
</div>
</ol>
</li>
<li>Reboot and login with domain user</li>
</ol>
</div>benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com3tag:blogger.com,1999:blog-2007777945604913635.post-67291575881255177142014-02-25T06:35:00.000-08:002014-02-25T06:35:31.248-08:00Audio virus (Trojan.Zekos.Patchedww2)A user experienced a problem where their laptop would play audio ads when started.<br />
<br />
OS: Windows Vista<br />
<br />
After trying all the usual tools the audio ads continued to play. Running <a href="http://www.malwarebytes.org/antirootkit/" target="_blank">Malwarebytes Anti-Rootkit BETA v1.07.0.1009</a> found a virus (Trojan.Zekos.Patchedwv2) in C:\Windows\System32\rpcss.dll.<br />
<br />
<br />
Other symptoms:<br />
<ul>
<li>DCOM Launcher and PlugPlay services have high CPU utilization</li>
<li>Vista restarts with message "Windows must now restart because the DCOM Server Process Launcher service terminated unexpectedly". This message does not allow you to prevent the machine from rebooting, the only option is "Close"</li>
</ul>
Other steps tried (unsucessfully):<br />
<ul>
<li>Malwarebytes (regular version)</li>
<li>Every pertinent tool on Hiren Rescue CD</li>
<li>Panda Antivirus scan</li>
<li>Kapersky TDSSKiller</li>
<li>RKill</li>
</ul>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-51886427958059482382014-01-14T06:00:00.003-08:002014-01-14T06:05:59.537-08:00Glassfish deployment issue: "Could not load any resource bundle by...."While attempting to redeploy a web project to Glassfish the following error occurred:<br />
<blockquote class="tr_bq">
"Could not load any resource bundle by com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages"</blockquote>
When trying to restart the Glassfish domain it ran into errors and would not start. After some troubleshooting the problem turned out to be with the Glassfish server not Glassfish or the project. It turns out that a teammate ran into some problems while running updates on the Ubuntu server that was hosting Glassfish and that caused java to be temporarily uninstalled (which would obviously cause problems for the java application server). After re-running the updates, rebooting, then re-running updates again (not sure if all of these steps were necessary) the Glassfish domain was able to start and deployment of the project worked with no errors.benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-64548578079015236402013-12-31T11:21:00.005-08:002013-12-31T11:21:46.497-08:00Javascript Event KeysWays to get the keycode (or charcode) of keys that were pressed.<br />
<br />
onkeypress:<br />
<ul>
<li>which (i.e. e.which)</li>
</ul>
onkeyup/onkeydown:<br />
<ul>
<li> keyCode (i.e. e.keyCode)</li>
</ul>
<br />
<blockquote class="tr_bq">
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"><script></span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> function testkeydown(e)</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> {</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> alert("Key pressed was " + e.keyCode);</span></span><span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> }</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"><br /></span></span>
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> function testkeyup(e)</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> {</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> testkeydown(e);</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> }</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"><br /></span></span>
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> function testkeypress(str, e)</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> {</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> alert("Key pressed was " + e.which + " and the additional parameter was " + str + ".");</span></span><span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"> }</span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"></script> </span></span><br />
<br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"><input type="text" onkeydown="testkeydown(event);" /></span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"><input type="text" onkeyup="testkeyup(event);" /></span></span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;"><input type="text" onkeypress="testkeypress("additional parameter", event);" /></span></span></blockquote>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-21080509338553201332013-10-30T10:58:00.002-07:002013-10-30T10:58:42.553-07:00uses a non-entity as target entity in the relationshipThis error or similar appears in the Glassfish server log even though everything appears correct in the project. Double-check the persistence.xml to be sure it is correct. If it is, the problem is likely being caused by a cached persistence.xml. If you are using an IDE such as Netbeans be sure to Clean & Build before deploying.benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-29780316559858588642013-10-30T10:56:00.001-07:002014-04-07T11:21:53.736-07:00Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.According to this site (<a href="http://richardchesterwood.blogspot.com/2011/09/javaee-course-ships-with-copy-of-javaee.html" target="_blank">site</a>), this is caused by a Glassfish bug and redeploying will fix this. The following steps solved the issue:<br />
<br />
<ol>
<li>Undeploy the project</li>
<li>Restart the Glassfish server</li>
<li>Clean and build project</li>
<li>Deploy project to Glassfish server</li>
</ol>
<br />
These steps work using the following configurations:<br />
<ul>
<li>Netbeans 7.4 and Glassfish 4.0</li>
<li>Netbeans 8.0 and Glassfish 4.0</li>
</ul>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-561905933381225592013-10-25T07:11:00.004-07:002013-10-25T07:40:15.373-07:00SSH issues in Ubuntu<u><b>Problem 1</b></u>:<br />
<br />
When using ssh to connect to a remote server from an Ubuntu based machine, there is a long delay before the password prompt is displayed.<br />
<br />
<b>Solution</b>:<br />
<br />
On the local machine, edit the ~/.ssh/config file (or create it if it does not exist) and add the line:<br />
<br />
<div class="code">
GSSAPIAuthentication=no</div>
<br />
<br />
<hr />
<br />
<u><b>Problem 2</b></u>:<br />
<br />
When connected to a remote server with ssh, if idle too long, connection will be ended with this message:<br />
<br />
<div class="code">
Write failed: Broken pipe</div>
<br />
<br />
<b>Solution</b>:<br />
<br />
On the local machine, edit the ~/.ssh/config file (or create it if it does not exist) and add the line:<br />
<br />
<div class="code">
ServerAliveInterval 120</div>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-74332209734807959742013-10-14T08:05:00.004-07:002013-10-14T08:05:57.541-07:00Runtime ClassNotFoundExceptions may result<u><b>Problem: </b></u><br />
<br />
When using Eclipse Kepler to create Java EE projects, I was getting the following warnings:<br />
<br />
<span style="font-size: x-small;"><i>Classpath entry <jar library here> will not be exported or published. Runtime ClassNotFoundExceptions may result.</i></span><br />
<br />
<u><b>Solution:</b></u><br />
<br />
The warning is telling me that the jar file (in my case it was a log4j library) will not be included in the archive that is deployed to application server. This warning is just a reminder that unless you put the jar file in the classpath of the application server you will receive ClassNotFoundExceptions when trying to run the projects. A very handy reminder but somewhat irritating since I don't like the little yellow triangle with exclamation point that appears on the project because of the warning. The can be fixed by adding the jar file for the required library to the Deployment Assembley (Project Properties -> Deployment Assembly -> Add... -> Java Build Path Entries -> <jar library>). The downside to this is that the jar will be included in the EAR or WAR that is generated thus making is much larger.benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com1tag:blogger.com,1999:blog-2007777945604913635.post-23291292263156237362013-10-02T17:51:00.003-07:002013-10-02T17:53:14.719-07:00Null or zero primary key encountered in unit of work clone<b>Null or zero primary key encountered in unit of work clone [Object@3622086c], primary key [0]. Set descriptors IdValidation or the "eclipselink.id-validation" property.</b><br />
<br />
Ran into this at runtime when running a EJB on Glassfish using JPA Entities. The problem turned out to be a missing annotation on one of the properties in one of the JPA Entities (@GeneratedValue).<br />
<br />
The value in question was the primary key for the table and was auto-generated.<br />
<br />
Full corrected code:<br />
<blockquote class="tr_bq" style="background-color: lightgrey;">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">@Id</span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">@GeneratedValue(strategy = GenerationType.IDENTITY)<br />private int id;</span></span></blockquote>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-33907769262610655492013-08-14T08:05:00.001-07:002013-10-25T07:14:21.205-07:00Setup Git RepositoryI created a Git server to host our companies code repositories. It is an ubuntu server with ssh enabled and git installed. Here are steps I use to create a new repository:<br />
1. Create directory to host new repository<br />
<blockquote>
<span style="font-family: 'courier new', courier;">$ sudo mkdir /testrepo1</span></blockquote>
2. Change group of repository directory to group used by developers that will be using this repository<br />
<blockquote>
<span style="font-family: 'courier new', courier;">$ sudo chgrp -R git /testrepo1</span></blockquote>
3. Change default permissions on directory so that all new files will be crated with the new group<br />
<blockquote>
<span style="font-family: 'courier new', courier;">$ sudo chmod g+rws /testrepo1</span><br />
<span style="font-family: 'courier new', courier;">$ sudo git --base /testrepo1</span></blockquote>
4. Initialize empty Git repository<br />
<blockquote>
<span style="font-family: 'courier new', courier;">$ cd /testrepo1</span><br />
<span style="font-family: 'courier new', courier;">$ git --bare init --shared=group</span></blockquote>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-51460027134786128262013-05-16T05:46:00.002-07:002013-10-25T07:14:34.075-07:00InnoDB: Unable to lock ./ibdata1, error: 11This is an error I see in the logs from time to time. I am running a MySQL server with an openvz container on a Proxmox server. From time to time the Proxmox server will crash which causes all the VMs it is running to stop unexpectedly (in defense of Proxmox this has only happened on a development box that is installed on a workstation). When I attempt to access the MySQL server through the MySQL Workbench I get an error like "Can't connect to the MySQL server on <server name> (111)":<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-12tz60y88w0/UZTOy1O1wtI/AAAAAAAABS4/aMYQaTeUbCU/s1600/mysql+workbench+error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="http://1.bp.blogspot.com/-12tz60y88w0/UZTOy1O1wtI/AAAAAAAABS4/aMYQaTeUbCU/s320/mysql+workbench+error.png" width="320" /></a></div>
I also receive an error when trying to access the database from the command line:<br />
<div style="background-color: lightgrey; border: 1px solid black; font-family: courier new; font-size: 10px; margin-left: 10px; margin-right: 10px;">
# mysql -u root -p<br />
Enter password: <br />
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)</div>
<br />
In the logs I found:<br />
<div style="background-color: lightgrey; border: 1px solid black; font-family: courier new; font-size: 10px; margin-left: 10px; margin-right: 10px;">
InnoDB: Unable to lock ./ibdata1, error: 11<br />
InnoDB: Check that you do not already have another mysqld process<br />
InnoDB: using the same InnoDB data or log files.<br />
InnoDB: Error in opening ./ibdata1</div>
<br />
I was able to fix the problem by restoring the permissions on several files (modified from <a href="http://tercan-eng.blogspot.com/2010/08/mysql-unable-to-lock-ibdata1-error-11.html">this</a> post):<br />
<div style="background-color: lightgrey; border: 1px solid black; font-family: courier new; font-size: 10px; margin-left: 10px; margin-right: 10px;">
# cd /var/lib/mysql<br />
# mkdir bak<br />
# mv ibdata1 bak/.<br />
# mv ib_logfile* bak/.<br />
# cp -a bak/ibdata1 ibdata1<br />
# cp -a bak/ib_logfile* .<br />
# service mysql restart</div>
<br />benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-82039180989750496372013-04-10T06:24:00.001-07:002014-05-01T13:24:10.478-07:00Ubuntu 12.04 Joomla 3I recently setup an Ubuntu server with Joomla 3. I used the instructions found <a href="http://ubuntuserverguide.com/2012/10/how-to-installing-cms-joomla-3-0-on-ubuntu-server-12-04.html" target="_blank">here</a> with a few modifications. I did not want the joomla site to be under the /joomla subdirectory so I skipped the first three commands under step 2. The steps I used are as follows:<br />
<br />
<ol>
<li><pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="margin: 0px; padding: 0px;">sudo apt-get install lamp-server^</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">mysql -u root -p</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">CREATE DATABASE dbjoomla;</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">CREATE USER joomlauser;</b></pre>
(Change <password> to the password of your choice)<br />
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">SET PASSWORD FOR joomlauser = PASSWORD("<password>");</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">GRANT ALL PRIVILEGES ON dbjoomla.* TO joomlauser@localhost IDENTIFIED BY '<password>';</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">FLUSH PRIVILEGES;</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">exit</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">wget http://joomlacode.org/gf/download/frsrelease/17965/78414/Joomla_3.0.3-Stable-Full_Package.zip</b></pre>
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">sudo unzip -q Joomla_3.0.1-Stable-Full_Package.zip -d /var/www</b></pre><i>You will want to remove the index.html that exists in /var/www by default</i><br />
<pre style="background-color: #eeeeee; border: 1px solid #dddddd; clear: both; color: #111111; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 0.923em; line-height: 1.5em; margin-bottom: 1.667em; margin-top: 0px; overflow: auto; padding: 0.583em 0.833em;"><b style="font-size: 0.923em; line-height: 1.5em; margin: 0px; padding: 0px;">sudo chown -R www-data.www-data /var/www</b></pre>
Install joomla 3.0 from a browser by typing http://[hostname]</li>
</ol>
benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-54615974354724422632013-02-13T13:20:00.001-08:002013-03-27T13:08:32.814-07:00Locale error<p><span style="text-decoration: underline;">August 8, 2012</span></p><div style="color: #444444; font-family: Arial, Verdana, sans-serif; font-size: 13px; line-height: 21px; background-color: #ffffff;">I had been getting an error on some Ubuntu servers when using apt:</div><blockquote style="font-style: italic; color: #444444; font-family: Arial, Verdana, sans-serif; font-size: 13px; line-height: 21px; background-color: #ffffff; margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><span style="background-color: #cccccc;">locale: Cannot set LC_CTYPE to default locale: No such file or directory </span></div><div><span style="background-color: #cccccc;">locale: Cannot set LC_MESSAGES to default locale: No such file or directory</span></div><div><span style="background-color: #cccccc;">locale: Cannot set LC_ALL to default locale: No such file or directory </span></div></blockquote><p><span style="color: #444444; font-family: Arial, Verdana, sans-serif; font-size: 13px; line-height: 21px; background-color: #ffffff;">After some googling I found a solution:</span></p><div style="color: #444444; font-family: Arial, Verdana, sans-serif; font-size: 13px; line-height: 21px; background-color: #ffffff;"><blockquote style="font-style: italic; margin: 0px 0px 0px 40px; border: none; padding: 0px;"><span style="background-color: #cccccc;">localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 </span></blockquote><blockquote style="font-style: italic; margin: 0px 0px 0px 40px; border: none; padding: 0px;"><br /></blockquote>EDIT: This occurs when I setup Ubuntu 12.04 servers using an openvz image that I downloaded (I don't remember from where).</div><p> </p>benhttp://www.blogger.com/profile/13973287374297153646noreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-18798887899984725862012-06-14T06:37:00.000-07:002013-03-27T13:09:19.162-07:00Expand Proxmox VM<p>These are the steps I took to expand the hard drive of a Windows 2003 server running on Proxmox<br />I found these steps <a href="http://forum.proxmox.com/threads/3757-Extending-VM-Hard-Drives?p=21099#post21099">here</a>.</p><ol><li>Shutdown server</li><li>Create backup</li><li>Expand disk in my case it was to 60GB which is 64424509440 bytes which you divide by the bit size for the "seek" option (125829120):</li><blockquote style="background-color: lightgrey; font-family: "Courier New", Courier, monospace;"><p><span style="font-size: x-small;"><span>~#</span></span><span style="font-size: x-small;"> cd /var/lib/vz/images/101<br />~# dd if=/dev/zero of=vm-101-disk-1.raw bs=512 count=0 seek=125829120</span></p></blockquote><li>Restart pvedaemon:</li><blockquote style="background-color: lightgrey; font-family: "Courier New", Courier, monospace;"><p><span style="font-size: x-small;">~#</span><span style="font-size: x-small;"> /etc/init.d/pvedaemon restart</span></p></blockquote><li>Add GParted live CD to virtual CD drive and boot server</li><li>Resize NTFS partition with GParted interface</li><li><span style="font-size: x-small;"><span style="font-size: small;">Reboot server (Windows will run a constistency check because of the new disk size)</span></span></li></ol>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-26363874062457070812012-03-07T12:25:00.000-08:002013-03-27T13:08:52.693-07:00Glassfish 3.1.2 on Ubuntu 11.10These are the steps I took to install Glassfish 3.1.2 on Ubuntu 11.10.<br />
<br />
I should point out that I used a Proxmox KVM virtual server for this. I first tried an OpenVZ virtual server but kept running into an error: "There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server." After some googling I decided this error had something to do with the networking which is significantly different on OpenVZ than KVM so I abandoned the OpenVZ container and created a KVM virtual host.<br />
<br />
These steps are a combination of two other guides in order to provide an internal Glassfish server that is password protected (<a href="http://blog.rueedlinger.ch/2012/02/glassfish-3-1-and-mysql-5-1-on-ubuntu-server-11-10/">here</a> and <a href="http://nabisoft.com/tutorials/glassfish/installing-glassfish-31-on-ubuntu">here</a>).<br />
<br />
Before I began I installed Ubuntu 11.10 server (64-bit) on the Proxmox KVM virtual machine and updated to the latest available updates then backed-up the virtual machine. <br />
<br />
<ol>
<li>Install Java (I chose the natively available version of Java, openjdk):</li>
<blockquote style="background-color: lightgrey;">
<span style="font-family: 'courier new'; font-size: x-small;">~# sudo apt-get install openjdk-7-jdk</span></blockquote>
<li>Install the unzip utility (not included by default in Ubuntu 11.10):</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"><span style="font-size: x-small;">~# sudo apt-get install unzip</span></span></span></blockquote>
<li>Create user and group to install and run Glassfish (I chose glassfish and glassfishadm):</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;"><span class="Apple-style-span">~#</span></span><span style="font-size: x-small;"> sudo adduser --home /home/glassfish --system --shell /bin/bash glassfish<br />~# sudo groupadd glassfishadm<br />~# sudo usermod -a -G glassfishadm glassfish</span></blockquote>
<li>Change to glassfish user:</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">~# sudo su - glassfish</span></span></blockquote>
<li>Get Glassfish zip:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> </span><span style="font-size: x-small;">wget http://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1.zip</span></blockquote>
<li>Unzip glassfish and move it to root of glassfish user home folder:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> unzip glassfish-3.1.2.zip<br />~# mv glassfish3/* .</span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">~# rm -r glassfish3</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">~# rm glassfish-3.1.2.zip</span></span></blockquote>
<li>Change owner and group of entire folder: </li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> chown -R glassfish *<br />~# chgrp -R glassfishadm *</span></blockquote>
<li>Exit glassfish user:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> </span><span style="font-size: x-small;">exit</span></blockquote>
<li>Create script to start and stop Glassfish server at /etc/init.d/glassfish. This script will use the glassfish user to start and stop the Glassfish instance so that it does not run as root:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">#!/bin/bash<br /><br />case "$1" in<br />start)<br /> su - glassfish -c "/home/glassfish/bin/asadmin start-domain domain1"<br /> ;;<br />stop)<br /> su - glassfish -c "/home/glassfish/bin/asadmin stop-domain domain1"<br /> ;;<br />restart)<br /> su - glassfish -c "/home/glassfish/bin/asadmin stop-domain domain1"<br /> su - glassfish -c "/home/glassfish/bin/asadmin start-domain domain1"<br /> ;;<br />*)<br /> echo "usage: $0 {start|stop|restart}"<br /> ;;<br /><br />esac<br /><br />exit 0</span></blockquote>
<li>Set script to run at boot:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> </span><span style="font-size: x-small;">sudo chmod u+x /etc/init.d/glassfish<br />~# sudo update-rc.d glassfish defaults</span></blockquote>
<li>Set admin password (default password for admin is blank):</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-family: "Courier New",Courier,monospace; font-size: x-small;">~#</span><span style="font-family: "Courier New",Courier,monospace; font-size: x-small;"> </span><span style="font-family: "Courier New",Courier,monospace; font-size: x-small;">sudo su - glassfish -c "/home/glassfish/bin/asadmin --user admin change-admin-password"<br />Enter admin password> _</span><span style="font-size: x-small;"><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">Enter new admin password></span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">Enter new admin password again></span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">Command change-admin-password executed successfully.</span></span></blockquote>
<li>Set security on Glassfish:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> </span><span style="font-size: x-small;">sudo su - glassfish -c "/home/glassfish/bin/asadmin enable-secure-admin"</span></blockquote>
<li>Start the server:</li>
<blockquote style="background-color: lightgrey; font-family: "Courier New",Courier,monospace;">
<span class="Apple-style-span" style="font-size: x-small;">~#</span><span style="font-size: x-small;"> </span><span style="font-size: x-small;">sudo /etc/init.d/glassfish start</span></blockquote>
</ol>Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2007777945604913635.post-53626118533898235622012-01-13T04:42:00.000-08:002013-03-27T13:08:52.694-07:00Redmine on Ubuntu 11.04 using MySQLI decided to give Redmine a try and ran into a few issues using most of the guides out there to get it installed. The guide that worked is below but be sure to install your mysql server (sudo apt-get install mysql-server) first.<br />
<br />
<a href="http://foxfoo.com/howto-install-redmine-on-ubuntu-1104.html">http://foxfoo.com/howto-install-redmine-on-ubuntu-1104.html</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-29397520663576555012011-10-24T12:17:00.000-07:002013-04-15T04:44:47.762-07:00Resizing with LVMI am running a proxmox server with several virtual machines and noticed that I have more disk space configured on the virtual machines then I have on the partition they are running on. Here are the steps I took to increase the size of the ext3 partition hosting the vms.<br />
<br />
<br />
<ol>
<li>View the mount points to determine what logical volume the vms are on</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">~# mount</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">/dev/pve/root on / type ext3 (rw,errors=remount-ro)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">proc on /proc type proc (rw,noexec,nosuid,nodev)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">procbususb on /proc/bus/usb type usbfs (rw)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">udev on /dev type tmpfs (rw,mode=0755)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="background-color: yellow; font-size: 12px;">/dev/mapper/pve-data on /var/lib/vz type ext3 (rw)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">/dev/cciss/c0d0p1 on /boot type ext3 (rw)</span></span><br />
<div style="font-family: 'courier new'; font-size: 12px;">
</div>
</blockquote>
<li>View the logical volume to determine what volume group it is on:</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">~# lvdisplay /dev/mapper/pve-data</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> --- Logical volume ---</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> LV Name /dev/pve/data</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="background-color: yellow; font-size: 12px;"> VG Name pve</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"></span></span></blockquote>
<li>View the volume group to be sure there is room for expansion:</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">~# vgdisplay pve</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> --- Volume group ---</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> VG Name pve</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> System ID</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Format lvm2</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Metadata Areas 2</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Metadata Sequence No 2236</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> VG Access read/write</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> VG Status resizable</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> MAX LV 0</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Cur LV 3</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Open LV 3</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Max PV 0</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Cur PV 2</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Act PV 2</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> VG Size 477.93 GB</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> PE Size 4.00 MB</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Total PE 122351</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Alloc PE / Size 44928 / 175.50 GB</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="background-color: yellow; font-size: 12px;"> Free PE / Size 77423 / 302.43 GB</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> VG UUID ThGaW0-KPoF-ZA3V-jgxE-zv6d-jaMY-Pc8Y1W</span></span></blockquote>
<li>Extend the logical volume (-L flag as used below allows you to specify the new size of the volume):</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">~# lvextend -L150G /dev/pve/data</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Extending logical volume root to 150.00 GB</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;"> Logical volume root successfully resized</span></span></blockquote>
<li>Resize the ext3 partition</li>
<blockquote style="background-color: lightgrey;">
<span class="Apple-style-span" style="font-family: 'courier new'; font-size: 12px;">~# resize2fs /dev/pve/data</span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">resize2fs 1.41.3 (12-Oct-2008)</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">Filesystem at /dev/pve/data is mounted on /var/lib/vz; on-line resizing required</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">old desc_blocks = 4, new_desc_blocks = 10</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">Performing an on-line resize of /dev/pve/data to 39321600 (4k) blocks.</span></span><br />
<span class="Apple-style-span" style="font-family: 'courier new';"><span class="Apple-style-span" style="font-size: 12px;">The filesystem on /dev/pve/data is now 39321600 blocks long.</span></span></blockquote>
</ol>
Pretty easy.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-34414518259894613252011-01-10T12:25:00.000-08:002013-04-15T04:44:23.764-07:00Create copy of VM on Proxmox<ol>
<li>Ssh into the Proxmox server as root.</li>
<li>Run "vzdump" with desired VMID.</li>
<blockquote style="background-color: lightgrey;">
$vzdump 101</blockquote>
<li>Run "qmrestore" with unused VMID. Your dump file should be located in /var/lib/vz/dump.</li>
<blockquote style="background-color: lightgrey;">
$qmrestore /var/lib/vz/dump/vzdump-qemu-101-2011_01_10-11_13_30.tar 102</blockquote>
</ol>
<div>
I tested this with a Ubuntu server 10.10 VM. From the Proxmox console I deleted the network device and recreated it to be sure it had a unique MAC address (not sure if that was necessary). I started the new VM, logged in, and changed the hostname and some values for the apache server.<br />
<br />
<hr />
**UPDATE (02/09/2011)**<br />
I noticed that when running the this command I would see:<br />
<blockquote style="background-color: lightgrey;">
INFO: mode failure - unable to dump into snapshot (use option --dumpdir)</blockquote>
After some intrepid googling I discovered this was because the dump was being created on the same lvm group vzdump had to suspend the vm to do the backup. To avoid this (since I was backing up a live webserver) I mounted a windows share (on a domain) and pointed the dump to there.<br />
<br />
<ol>
<li>Mount the windows share to the /mnt/share directory (be sure that directory exists)</li>
<blockquote style="background-color: lightgrey;">
$mount -t smbfs //server/share /mnt/share -o username=domainuser</blockquote>
<li>Run vzdump with the --dumpdir option</li>
<blockquote style="background-color: lightgrey;">
$vzdump --dumpdir /mnt/share/dumps 101</blockquote>
</ol>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2007777945604913635.post-19664744178965478692011-01-10T11:57:00.000-08:002013-03-27T13:09:28.317-07:00Linux DNS entryAs I was playing with linux servers I noticed that a DNS entry was not being created when I added new servers to the network. After some googling I found the solution. If you are running dhcp3 update your dhclient.conf (mine was under /etc/dhcp3) to include the following line:<br />
<br />
<blockquote style="background-color: lightgray;">send fqdn.server-update on;</blockquote><br />
Restart networking.Unknownnoreply@blogger.com0